From 739bcbbd83115cb8cf3f5b60fd7e73056a0c7293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Sun, 29 Sep 2019 09:05:20 +0800 Subject: Correct type sizing --- ticket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ticket.c b/ticket.c index 3fb328c..2e26b81 100644 --- a/ticket.c +++ b/ticket.c @@ -61,10 +61,12 @@ static size_t search_callback(void *contents, size_t size, size_t nmemb return realsize; } } while ((line = strtok(NULL, "\n"))); + rtclient_ticketlist *ptr = realloc(*listptr, sizeof(*listptr) - + (*listptr)->length * sizeof(char *)); + + (*listptr)->length * sizeof(rtclient_ticket)); *listptr = ptr; rtclient_ticketlist *list = *listptr; + char *linesaveptr = NULL; line = strtok_r(lines, "\n", &linesaveptr); line = strtok_r(NULL, "\n", &linesaveptr); -- cgit v1.2.3