From eb1eee03a6796e0d7651ca77fea0ea705b41d70a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Jun 2009 12:43:43 -0600 Subject: [PATCH] demos: improve argv parsing in fslight.c --- progs/demos/fslight.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c index 41a13cc9f46..f0d76a4a06f 100644 --- a/progs/demos/fslight.c +++ b/progs/demos/fslight.c @@ -583,10 +583,14 @@ ParseOptions(int argc, char *argv[]) int i; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-fs") == 0) { - FragProgFile = argv[i+1]; + FragProgFile = argv[++i]; } else if (strcmp(argv[i], "-vs") == 0) { - VertProgFile = argv[i+1]; + VertProgFile = argv[++i]; + } + else { + fprintf(stderr, "unknown option %s\n", argv[i]); + break; } } } -- 2.30.2