allow envp missing

This commit is contained in:
John
2023-10-03 08:28:43 +02:00
parent 28bebfa49d
commit 37334c54f9
+1 -1
View File
@@ -633,7 +633,7 @@ int parse_main_args(int argc, char* argv[], char* envp[], options_t *opt, int *a
char envname[32] = "--"; // needs to cover at least max length of any option name plus "--"
char* envopt = envname+2;
for (char ** env = envp; *env; env++) {
for (char ** env = envp; env && *env; env++) {
char* pos = strchr(*env, '=');
if (!pos || strncmp(*env, "EBUSD_", sizeof("EBUSD_")-1) != 0) {
continue;