fix some undefined behaviour
@@ -184,7 +184,9 @@ void cmdline(int* argcp, char* argv[], int min_args, int max_args, const char* u
int argc = *argcp;
// create writable copy of opts
- struct opt_s wopts[n];
+ struct opt_s wopts[n ?: 1];
+
+ if (NULL != opts)
memcpy(wopts, opts, sizeof wopts);
