diff options
Diffstat (limited to 'decode.c')
| -rw-r--r-- | decode.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -491,6 +491,18 @@ gemtext_list_decode(char *text) ret = append; } + /* + * if this is reached, it means there was no text to parse + * therefore NULL would be returned, but we don't want that + * because it is the error indicator, so we'll create an + * empty list + */ + if (ret == NULL) { + ret = malloc(sizeof(*ret)); + if (ret == NULL) + return NULL; + ret[0] = NULL; + } return ret; } |