diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-10-13 13:54:46 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-10-13 13:54:46 +0000 |
commit | 2a2ef8b0757b8e04b2a6d3b7bab46826f4176adc (patch) | |
tree | a1d061626baa9e965bfb80bb63fb4ede5ee72da1 | |
parent | cc33e898fcf4df23c27a2ba95c676f6962a475af (diff) |
Checks the return of SplitString and doesn't pass a null string to the parameter
stuff.
Fixes PR/96.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1017 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | src/main/CommandLine.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/main/CommandLine.c b/src/main/CommandLine.c index 83810361..4c6068b8 100644 --- a/src/main/CommandLine.c +++ b/src/main/CommandLine.c @@ -86,13 +86,22 @@ void CCTKi_CommandLineDescribeParameter(const char *optarg) Util_SplitString(þ, ¶m, optarg, "::"); - ParameterPrintDescription(param, - thorn, /*const char *thorn,*/ - "..%s..%s\n",/* const char *format,*/ - stdout); - + if(!param) + { + ParameterPrintDescription(optarg, + NULL, /*const char *thorn,*/ + "..%s..%s\n",/* const char *format,*/ + stdout); + } + else + { + ParameterPrintDescription(param, + thorn, /*const char *thorn,*/ + "..%s..%s\n",/* const char *format,*/ + stdout); free(thorn); free(param); + } exit(1); } |