aboutsummaryrefslogtreecommitdiff
path: root/src/apps/optargpm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/apps/optargpm.h')
-rw-r--r--src/apps/optargpm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/apps/optargpm.h b/src/apps/optargpm.h
index 9a66b9a0..921b8c0b 100644
--- a/src/apps/optargpm.h
+++ b/src/apps/optargpm.h
@@ -415,6 +415,9 @@ OPTARGS *opt_parse (int argc, char **argv, const char *flags, const char *keys,
int free_format;
OPTARGS *o;
+ if( argc == 0 )
+ return nullptr;
+
o = (OPTARGS *) calloc (1, sizeof(OPTARGS));
if (nullptr==o)
return nullptr;