summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-18 09:15:33 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-18 09:15:33 +0800
commitd02b12952dd43b6e46177508bb5268ea31c70d15 (patch)
tree2ec3b27c56b7720d00deca46eec76fa09921dc1e
parentc9a800017c40ef620f3bbbcc3dc49b831429dfd6 (diff)
Empty ticket list returns the list as NULL
-rw-r--r--ticket.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ticket.c b/ticket.c
index 2751b37..6290dcb 100644
--- a/ticket.c
+++ b/ticket.c
@@ -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 *));