summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ticket.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ticket.c b/ticket.c
index 4960969..821f982 100644
--- a/ticket.c
+++ b/ticket.c
@@ -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