summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-10-06 20:35:26 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-10-06 20:35:26 +0800
commit1309b6615004bd993506f0e71333d50599220e53 (patch)
tree415f414ee19122c2ffdc5d003170eaab4c289523
parent683b27bfbae3be046e8d9c559ee74872ede1ee14 (diff)
Simplify reallocation
-rw-r--r--search.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/search.c b/search.c
index 4b8c5d0..1de25f0 100644
--- a/search.c
+++ b/search.c
@@ -30,10 +30,8 @@ static size_t ticket_handler(void *contents, size_t size, size_t nmemb
}
} while ((line = strtok(NULL, "\n")));
- rtclient_search_ticket_list *ptr = realloc(*listptr
- , sizeof(rtclient_search_ticket_list)
+ *listptr = realloc(*listptr, sizeof(rtclient_search_ticket_list)
+ (*listptr)->length * sizeof(rtclient_ticket));
- *listptr = ptr;
rtclient_search_ticket_list *list = *listptr;
char *linesaveptr = NULL;