From bb9370adaf2f3a741938c8d7f23baf5d5d5e5be1 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sat, 29 Sep 2012 15:35:22 -0400 Subject: [PATCH] Make the command line argument processing a little more robust. --- CLTool/src/clunix.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CLTool/src/clunix.cpp b/CLTool/src/clunix.cpp index b4ae4f1..ded6e88 100644 --- a/CLTool/src/clunix.cpp +++ b/CLTool/src/clunix.cpp @@ -38,12 +38,14 @@ int main(int argc, char **argv) { fileArg++; knowArg = true; + continue; } if(strcmp(argv[fileArg], "-s") == 0) { fileArg++; bUseSIMD = true; knowArg = true; + continue; } if(strcmp(argv[fileArg], "-t") == 0) { @@ -56,6 +58,7 @@ int main(int argc, char **argv) { fileArg++; knowArg = true; + continue; } if(strcmp(argv[fileArg], "-q") == 0) { @@ -68,6 +71,7 @@ int main(int argc, char **argv) { fileArg++; knowArg = true; + continue; } if(strcmp(argv[fileArg], "-j") == 0) { @@ -80,9 +84,10 @@ int main(int argc, char **argv) { fileArg++; knowArg = true; + continue; } - } while(knowArg); + } while(knowArg && fileArg < argc); if(fileArg == argc) { PrintUsage();