diff options
-rw-r--r-- | ticket.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -51,7 +51,6 @@ static size_t search_callback(void *contents, size_t size, size_t nmemb char *line = strtok(response, "\n"); if (strstr(line, "200 Ok")) { - (*listptr)->length = 0; line = strtok(NULL, "\n"); do { (*listptr)->length++; @@ -95,6 +94,8 @@ static size_t search_callback(void *contents, size_t size, size_t nmemb void rtclient_ticket_search(rtclient_ticketlist **listptr, const char *query) { *listptr = malloc(sizeof(rtclient_ticketlist)); + rtclient_ticketlist *list = *listptr; + list->length = 0; request(search_callback, (void *)listptr, NULL, "%s%s" , "/REST/1.0/search/ticket?query=", query); } |