From: John Hodge Date: Fri, 4 Mar 2011 08:43:22 +0000 (+0800) Subject: Fixed non-numeric arguments prefixed by '-' being allowed X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=897c1765b3b48b4552ecd479efca8d8af3c7e920;p=tpg%2Fopendispense2.git Fixed non-numeric arguments prefixed by '-' being allowed --- diff --git a/src/client/main.c b/src/client/main.c index 7d43db7..71f58f9 100644 --- a/src/client/main.c +++ b/src/client/main.c @@ -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");