From c4fd3a58689969511685d6817c75cf39c732fe7a Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 3 Nov 2014 18:48:06 -0500 Subject: [PATCH] Initialize empty argument list to contain NULL for the end slot --- source/opts.c | 1 + 1 file changed, 1 insertion(+) 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*)); -- 2.54.0