summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-10-06 20:41:47 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-10-06 20:41:47 +0800
commitee08b2235cf2fefdb48eafde9990babaca4b4495 (patch)
treefe79fa63abd5dc10bc6ab8143cafebcca69ee0c4
parent1309b6615004bd993506f0e71333d50599220e53 (diff)
Simplify list length syntax
-rw-r--r--search.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/search.c b/search.c
index 1de25f0..83af684 100644
--- a/search.c
+++ b/search.c
@@ -17,12 +17,13 @@ static size_t ticket_handler(void *contents, size_t size, size_t nmemb
strcpy(lines, response);
rtclient_search_ticket_list **listptr
= (rtclient_search_ticket_list **)writedata;
+ rtclient_search_ticket_list *list = *listptr;
char *line = strtok(response, "\n");
if (strstr(line, "200 Ok")) {
line = strtok(NULL, "\n");
do {
- (*listptr)->length++;
+ list->length++;
if (!strcmp(line, "No matching results.")) {
free(*listptr);
*listptr = NULL;
@@ -31,7 +32,7 @@ static size_t ticket_handler(void *contents, size_t size, size_t nmemb
} while ((line = strtok(NULL, "\n")));
*listptr = realloc(*listptr, sizeof(rtclient_search_ticket_list)
- + (*listptr)->length * sizeof(rtclient_ticket));
+ + list->length * sizeof(rtclient_ticket));
rtclient_search_ticket_list *list = *listptr;
char *linesaveptr = NULL;