summaryrefslogtreecommitdiffabout
path: root/src/main.c
authorSergey Poznyakoff <gray@gnu.org.ua>2005-09-14 15:31:01 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2005-09-14 15:31:01 (GMT)
commitf57cc5da1bceb61004225067c5c2111b96ebfdd7 (patch) (side-by-side diff)
treee620c0a61f76a7c1fa52fadcce351bded118d8cd /src/main.c
parentbd121a0e0440e7182d04eb22f099c96637f212ca (diff)
downloadcflow-f57cc5da1bceb61004225067c5c2111b96ebfdd7.tar.gz
cflow-f57cc5da1bceb61004225067c5c2111b96ebfdd7.tar.bz2
(main): Fixed coredump when no arguments were passed.
Diffstat (limited to 'src/main.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 11cec84..296a62d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -667,14 +667,15 @@ main(int argc, char **argv)
init();
- /* See comment to cleanup_processor */
- for (arglist = CAR(arglist); arglist; arglist = CDR(arglist)) {
- char *s = (char*)CAR(arglist);
- if (s[0] == '-')
- pp_option(s);
- else if (source(s) == 0)
- yyparse();
- }
+ if (arglist)
+ /* See comment to cleanup_processor */
+ for (arglist = CAR(arglist); arglist; arglist = CDR(arglist)) {
+ char *s = (char*)CAR(arglist);
+ if (s[0] == '-')
+ pp_option(s);
+ else if (source(s) == 0)
+ yyparse();
+ }
argc -= index;
argv += index;

Return to:

Send suggestions and report system problems to the System administrator.