summaryrefslogtreecommitdiffstats
path: root/iptables-restore.c
diff options
context:
space:
mode:
authorlaforge <laforge>2001-02-26 17:31:20 +0000
committerlaforge <laforge>2001-02-26 17:31:20 +0000
commit9a429943c16c491ba867ef7db1d64078dea645e9 (patch)
tree828149f26538839f8338504058c76608235c3465 /iptables-restore.c
parentaa6cc13605cc317e1f5d5ff113e893f1676dc103 (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 475f345..b4a8135 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);