summaryrefslogtreecommitdiffstats
path: root/iptables-restore.c
diff options
context:
space:
mode:
authorAndrás Kis-Szabó <kisza@sch.bme.hu>2001-02-26 17:31:20 +0000
committerHarald Welte <laforge@gnumonks.org>2001-02-26 17:31:20 +0000
commit764316a133db8e5e2d1f2a9d941ffae993d7c9d9 (patch)
tree828149f26538839f8338504058c76608235c3465 /iptables-restore.c
parent45493a864a4cb779c499b9743c9932233ce5fc86 (diff)
ip6tables-save/-restore by Kis-Szabo Andras
Diffstat (limited to 'iptables-restore.c')
-rw-r--r--iptables-restore.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/iptables-restore.c b/iptables-restore.c
index 475f345b..b4a81353 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -4,7 +4,7 @@
*
* This coude is distributed under the terms of GNU GPL
*
- * $Id$
+ * $Id: iptables-restore.c,v 1.8 2001/01/23 22:54:34 laforge Exp $
*/
#include <getopt.h>
@@ -252,6 +252,15 @@ int main(int argc, char *argv[])
argvsize = 8;
}
+ // strtok initcialize!
+ if ( buffer[0]!='[' )
+ {
+ if (!(newargv[argvsize] = strtok(buffer, " \t\n")))
+ goto ImLaMeR;
+ //break;
+ argvsize++;
+ }
+
/* strtok: a function only a coder could love */
for (i = argvsize; i < sizeof(newargv)/sizeof(char *);
i++) {
@@ -259,7 +268,7 @@ int main(int argc, char *argv[])
break;
ptr = NULL;
}
- if (i == sizeof(newargv)/sizeof(char *)) {
+ImLaMeR: if (i == sizeof(newargv)/sizeof(char *)) {
fprintf(stderr,
"%s: line %u too many arguments\n",
program_name, line);