From: Brian Paul Date: Thu, 18 Jun 2009 18:43:43 +0000 (-0600) Subject: demos: improve argv parsing in fslight.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb1eee03a6796e0d7651ca77fea0ea705b41d70a;p=mesa.git demos: improve argv parsing in fslight.c --- 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; } } }