Skip to content

Commit a45f532

Browse files
committed
fix segfaults
1 parent 9a27891 commit a45f532

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/conf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static const struct option_t *find_option(const char name[])
336336
struct option_t *option;
337337

338338
option = g_options;
339-
while (option) {
339+
while (option->name) {
340340
if (0 == strcmp(name, option->name)) {
341341
return option;
342342
}
@@ -427,7 +427,7 @@ static int conf_load_file(const char path[])
427427
}
428428

429429
// parse --option value / --option
430-
ret = conf_set(option, value);
430+
ret = conf_set(option, (ret == 2) ? value : NULL);
431431
if (ret == EXIT_FAILURE) {
432432
fclose(file);
433433
return EXIT_FAILURE;

0 commit comments

Comments
 (0)