From e2b244b707a9147c9fbd0df9a69373e8ebd2b5a5 Mon Sep 17 00:00:00 2001 From: Krunal Patel Date: Fri, 31 Aug 2012 17:06:09 +0200 Subject: Fix errors when compiling in debug mode. --- include/libipset/ui.h | 1 + src/ipset.c | 9 +++++---- src/ui.c | 4 ---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/libipset/ui.h b/include/libipset/ui.h index 78d5866..2b7119e 100644 --- a/include/libipset/ui.h +++ b/include/libipset/ui.h @@ -43,5 +43,6 @@ extern bool ipset_match_option(const char *arg, const char * const name[]); extern bool ipset_match_envopt(const char *arg, const char * const name[]); extern void ipset_shift_argv(int *argc, char *argv[], int from); extern void ipset_port_usage(void); +extern int ipset_parse_file(struct ipset_session *s, int opt, const char *str); #endif /* LIBIPSET_UI_H */ diff --git a/src/ipset.c b/src/ipset.c index e649f08..2709d7b 100644 --- a/src/ipset.c +++ b/src/ipset.c @@ -129,7 +129,7 @@ help(void) } int -ipset_parse_file(struct ipset_session *session UNUSED, +ipset_parse_file(struct ipset_session *s UNUSED, int opt UNUSED, const char *str) { if (filename != NULL) @@ -140,6 +140,7 @@ ipset_parse_file(struct ipset_session *session UNUSED, return 0; } +static int __attribute__ ((format (printf, 1, 2))) ipset_print_file(const char *fmt, ...) { @@ -190,7 +191,7 @@ restore(char *argv0) { int ret = 0; char *c; - FILE *fread = stdin; + FILE *rfd = stdin; /* Initialize newargv/newargc */ newargc = 0; @@ -202,10 +203,10 @@ restore(char *argv0) "Cannot open %s for reading: %s", filename, strerror(errno)); } - fread = fd; + rfd = fd; } - while (fgets(cmdline, sizeof(cmdline), fread)) { + while (fgets(cmdline, sizeof(cmdline), rfd)) { restore_line++; c = cmdline; while (isspace(c[0])) diff --git a/src/ui.c b/src/ui.c index bdd0602..ef722c7 100644 --- a/src/ui.c +++ b/src/ui.c @@ -179,10 +179,6 @@ ipset_match_cmd(const char *arg, const char * const name[]) * -! -exist */ -int -ipset_parse_file(struct ipset_session *session, - int opt, const char *str); - const struct ipset_envopts ipset_envopts[] = { { .name = { "-o", "-output" }, .has_arg = IPSET_MANDATORY_ARG, .flag = IPSET_OPT_MAX, -- cgit v1.2.3