diff options
Diffstat (limited to 'src/format.c')
-rw-r--r-- | src/format.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/format.c b/src/format.c index 598fbce..9b1bb2d 100644 --- a/src/format.c +++ b/src/format.c @@ -766,12 +766,12 @@ format_add_choice(struct format_choice **choices, char *offset, { struct format_choice *choice; int i; - if (values != NULL) { + if ((values != NULL) && (*values != NULL)) { choice = malloc(sizeof(*choice)); if (choice != NULL) { choice->offset = offset; choice->next = NULL; - for (i = 0; values[i] != NULL; i++) { + for (i = 0; (*values)[i] != NULL; i++) { continue; } choice->n_values = i; |