summaryrefslogtreecommitdiffstats
path: root/examples/rtnl-link-set.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-04-22 13:59:45 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2010-04-22 13:59:45 +0200
commita4ae4201a45858516cfb3e63ffd12c2d12acbb70 (patch)
tree22a4c98666bb0d4cb0d781475aab1fd905713009 /examples/rtnl-link-set.c
parentc0d2aec13192ece4211894554348cdf9ddcb5837 (diff)
fix lots of compilation warnings in example files
They have been spotted by -Wall -Wextra Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples/rtnl-link-set.c')
-rw-r--r--examples/rtnl-link-set.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/rtnl-link-set.c b/examples/rtnl-link-set.c
index 9be6635..87ac167 100644
--- a/examples/rtnl-link-set.c
+++ b/examples/rtnl-link-set.c
@@ -1,6 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
+#include <time.h>
#include <libmnl/libmnl.h>
#include <linux/if.h>
@@ -21,9 +23,9 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- if (strncasecmp(argv[2], "up") == 0)
+ if (strncasecmp(argv[2], "up", strlen("up")) == 0)
oper = IF_OPER_UP;
- else if (strncasecmp(argv[2], "down") == 0)
+ else if (strncasecmp(argv[2], "down", strlen("down")) == 0)
oper = IF_OPER_DOWN;
else {
fprintf(stderr, "%s is not `up' nor `down'\n", argv[2]);