diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-01 20:51:56 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-10-01 20:51:56 +0800 |
commit | 84207f6e0a54bdb8fb263ba4e0a90417e6352892 (patch) | |
tree | 4f267d0d2e5ede1237ed89635fbdd2a39c33782c /ticket.c | |
parent | 9c87e89acc77f59f5a110c6216fc9cab62011ff5 (diff) |
Ticket history data member might be empty
Diffstat (limited to 'ticket.c')
-rw-r--r-- | ticket.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -145,9 +145,13 @@ static size_t history_handler(void *contents, size_t size, size_t nmemb ticket_history->new_value = NULL; } else if (!strcmp(token, "Data")) { token = strtok_r(NULL, ":", &tokensaveptr); - ticket_history->data - = malloc(strlen(token)); - strcpy(ticket_history->data, ++token); + if (token && strcmp(token, "")) { + ticket_history->data + = malloc(strlen(token)); + strcpy(ticket_history->data + , ++token); + } else + ticket_history->data = NULL; } else if (!strcmp(token, "Description")) { token = strtok_r(NULL, ":", &tokensaveptr); ticket_history->description |