From 73e73ffdd5a3df45a61c3cd975b21c8cfc03f050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 13 Jun 2006 08:37:03 +0000 Subject: Fix command line parsing. --- progs/demos/stex3d.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'progs') diff --git a/progs/demos/stex3d.c b/progs/demos/stex3d.c index e4554d0..83ae368 100644 --- a/progs/demos/stex3d.c +++ b/progs/demos/stex3d.c @@ -342,19 +342,19 @@ parseCmdLine(int argc, char **argv) GLint i; for (i = 1; i < argc; i++) { - if (strstr(argv[i], "-w") == 0) { + if (strcmp(argv[i], "-help") == 0) { + printHelp(); + return GL_FALSE; + } + else if (strstr(argv[i], "-w") != NULL) { tex_width = atoi((argv[i]) + 2); } - else if (strstr(argv[i], "-h") == 0) { + else if (strstr(argv[i], "-h") != NULL) { tex_height = atoi((argv[i]) + 2); } - else if (strstr(argv[i], "-d") == 0) { + else if (strstr(argv[i], "-d") != NULL) { tex_depth = atoi((argv[i]) + 2); } - else if (strcmp(argv[i], "-help") == 0) { - printHelp(); - return GL_FALSE; - } else { printf("%s (Bad option).\n", argv[i]); printHelp(); -- cgit v1.1