Fixed non-numeric arguments prefixed by '-' being allowed
authorJohn Hodge <[email protected]>
Fri, 4 Mar 2011 08:43:22 +0000 (16:43 +0800)
committerJohn Hodge <[email protected]>
Fri, 4 Mar 2011 08:43:22 +0000 (16:43 +0800)
src/client/main.c

index 7d43db7..71f58f9 100644 (file)
@@ -273,6 +273,11 @@ int main(int argc, char *argv[])
                                gbDryRun = 1;
                                break;
                        default:
+                               if( !isdigit(argv[i][0]) ) {
+                                       fprintf(stderr, "%s: Unknown switch '%s'\n", argv[0], argv[i]);
+                                       ShowUsage();
+                                       return RV_ARGUMENTS;
+                               }
                                if( text_argc + 1 ==  MAX_TXT_ARGS )
                                {
                                        fprintf(stderr, "ERROR: Too many arguments\n");

UCC git Repository :: git.ucc.asn.au