]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
fix format warnings
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 29 May 2014 17:31:30 +0000 (10:31 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 29 May 2014 17:31:30 +0000 (10:31 -0700)
Enable format security, and fix the warning caused by printing
with string for format.

Makefile
ip/ipaddress.c

index 543d9e8e1c4cc964a96b24b69ae6d8ba8606cad2..9dbb29f3d0cdb414a7ee5772ec38d320c1c14b64 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,7 @@ HOSTCC = gcc
 DEFINES += -D_GNU_SOURCE
 CCOPTS = -O2
 WFLAGS := -Wall -Wstrict-prototypes  -Wmissing-prototypes
-WFLAGS += -Wmissing-declarations -Wold-style-definition
+WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
 
 CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
 YACCFLAGS = -d -t -v
index ce5e762c5b206784488532d346cfe64320b5f57d..76f478230ffeceec9817bf3fe3c8eff36a1cd206 100644 (file)
@@ -357,7 +357,7 @@ static void print_link_stats64(FILE *fp, const struct rtnl_link_stats64 *s,
                fprintf(fp, "    TX errors: aborted fifo    window  heartbeat");
                 if (carrier_changes)
                        fprintf(fp, " transns");
-               fprintf(fp, _SL_);
+               fprintf(fp, "%s", _SL_);
                fprintf(fp, "               %-7"PRIu64"  %-7"PRIu64" %-7"PRIu64" %-8"PRIu64"",
                        (uint64_t)s->tx_aborted_errors,
                        (uint64_t)s->tx_fifo_errors,
@@ -406,7 +406,7 @@ static void print_link_stats(FILE *fp, const struct rtnl_link_stats *s,
                fprintf(fp, "    TX errors: aborted fifo    window  heartbeat");
                 if (carrier_changes)
                        fprintf(fp, " transns");
-               fprintf(fp, _SL_);
+               fprintf(fp, "%s", _SL_);
                fprintf(fp, "               %-7u  %-7u %-7u %-8u",
                        s->tx_aborted_errors,
                        s->tx_fifo_errors,