From: Michael D. Lowis Date: Mon, 3 Nov 2014 23:48:06 +0000 (-0500) Subject: Initialize empty argument list to contain NULL for the end slot X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c4fd3a58689969511685d6817c75cf39c732fe7a;p=projs%2Fopts.git Initialize empty argument list to contain NULL for the end slot --- diff --git a/source/opts.c b/source/opts.c index ad13f27..db00d7a 100755 --- a/source/opts.c +++ b/source/opts.c @@ -301,6 +301,7 @@ const char** opts_select(const char* name, const char* tag) { const char** opts_arguments(void) { size_t index = 0; const char** ret = (const char**)malloc(sizeof(const char*)); + ret[0] = NULL; entry_t* entry = Arguments; while (NULL != entry) { ret = (const char**)realloc(ret, (index+2)*sizeof(const char*));