changeset 205:806e5fc6dd93

Fix segfault during command parsing Fix lw_cmdline to not call the parser function for aguments which have mandatory parameters but none were provided.
author William Astle <lost@l-w.ca>
date Wed, 23 May 2012 19:37:30 -0600
parents a21459814650
children 080bb67d84f2
files lwlib/lw_cmdline.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/lw_cmdline.c	Fri Mar 16 22:54:10 2012 -0600
+++ b/lwlib/lw_cmdline.c	Wed May 23 19:37:30 2012 -0600
@@ -518,6 +518,7 @@
 			if (!tstr && (parser -> options[j].flags & lw_cmdline_opt_optional) == 0)
 			{
 				fprintf(stderr, "Option %s requires argument.\n", parser -> options[j].name);
+				continue;
 			}
 		}
 		r = (*(parser -> parser))(parser -> options[j].key, tstr, input);