diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-18 09:15:33 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-18 09:15:33 +0800 |
commit | d02b12952dd43b6e46177508bb5268ea31c70d15 (patch) | |
tree | 2ec3b27c56b7720d00deca46eec76fa09921dc1e | |
parent | c9a800017c40ef620f3bbbcc3dc49b831429dfd6 (diff) |
Empty ticket list returns the list as NULL
-rw-r--r-- | ticket.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -21,6 +21,11 @@ static size_t search_callback(void *contents, size_t size, size_t nmemb line = strtok(NULL, "\n"); do { (*listptr)->length++; + if (!strcmp(line, "No matching results.")) { + free(*listptr); + *listptr = NULL; + return realsize; + } } while ((line = strtok(NULL, "\n"))); rtclient_ticketlist *ptr = realloc(*listptr, sizeof(*listptr) + (*listptr)->length * sizeof(char *)); |