[lib] fix compilation warnings
authorChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 19 Nov 2008 21:52:57 +0000 (22:52 +0100)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 19 Nov 2008 21:52:57 +0000 (22:52 +0100)
Newer gcc versions are more strict with was we pass a format arg
to *printf(). Please it.

libmultipath/parser.c
libmultipath/print.c

index 14e2137..070745d 100644 (file)
@@ -172,7 +172,7 @@ snprint_keyword(char *buff, int len, char *fmt, struct keyword *kw, void *data)
                f++;
                switch(*f) {
                case 'k':
-                       fwd += snprintf(buff + fwd, len - fwd, kw->string);
+                       fwd += snprintf(buff + fwd, len - fwd, "%s", kw->string);
                        break;
                case 'v':
                        r = kw->print(buff + fwd, len - fwd, data);
index 2ac5ad1..8b61f18 100644 (file)
@@ -579,7 +579,7 @@ snprint_multipath_header (char * line, int len, char * format)
                if (!(data = mpd_lookup(*f)))
                        continue; /* unknown wildcard */
 
-               PRINT(c, TAIL, data->header);
+               PRINT(c, TAIL, "%s", data->header);
                PAD(data->width);
        } while (*f++);
 
@@ -615,7 +615,7 @@ snprint_multipath (char * line, int len, char * format,
                        continue;
 
                data->snprint(buff, MAX_FIELD_LEN, mpp);
-               PRINT(c, TAIL, buff);
+               PRINT(c, TAIL, "%s", buff);
                PAD(data->width);
                buff[0] = '\0';
        } while (*f++);
@@ -649,7 +649,7 @@ snprint_path_header (char * line, int len, char * format)
                if (!(data = pd_lookup(*f)))
                        continue; /* unknown wildcard */
 
-               PRINT(c, TAIL, data->header);
+               PRINT(c, TAIL, "%s", data->header);
                PAD(data->width);
        } while (*f++);
 
@@ -685,7 +685,7 @@ snprint_path (char * line, int len, char * format,
                        continue;
 
                data->snprint(buff, MAX_FIELD_LEN, pp);
-               PRINT(c, TAIL, buff);
+               PRINT(c, TAIL, "%s", buff);
                PAD(data->width);
        } while (*f++);
 
@@ -721,7 +721,7 @@ snprint_pathgroup (char * line, int len, char * format,
                        continue;
 
                data->snprint(buff, MAX_FIELD_LEN, pgp);
-               PRINT(c, TAIL, buff);
+               PRINT(c, TAIL, "%s", buff);
                PAD(data->width);
        } while (*f++);