From 84b8ebed3ba8fc14837f18d805cdac512990a5b8 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: Wed, 2 Oct 2019 15:30:32 +0800 Subject: They will be initialised earlier --- ticket.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/ticket.c b/ticket.c index 0bf145f..a239fa7 100644 --- a/ticket.c +++ b/ticket.c @@ -177,9 +177,6 @@ static size_t history_l_handler(void *contents, size_t size, size_t nmemb else if (!strcmp(token, "Status")) ticket_history->type = RTCLIENT_TICKET_HISTORY_TYPE_STATUS; - else - ticket_history->type - = RTCLIENT_TICKET_HISTORY_TYPE_UNKNOWN; } else if (!strcmp(token, "Field")) { token = strtok_r(NULL, ":", &tokensaveptr); if (!strcmp(++token, "Priority")) @@ -191,9 +188,6 @@ static size_t history_l_handler(void *contents, size_t size, size_t nmemb else if (!strcmp(token, "Owner")) ticket_history->field = RTCLIENT_TICKET_HISTORY_FIELD_OWNER; - else - ticket_history->field - = RTCLIENT_TICKET_HISTORY_FIELD_NONE; } else if (!strcmp(token, "OldValue")) { token = strtok_r(NULL, ":", &tokensaveptr); if (token && strcmp(token, "")) { @@ -201,8 +195,7 @@ static size_t history_l_handler(void *contents, size_t size, size_t nmemb = malloc(strlen(token)); strcpy(ticket_history->old_value , ++token); - } else - ticket_history->old_value = NULL; + } } else if (!strcmp(token, "NewValue")) { token = strtok_r(NULL, ":", &tokensaveptr); if (token && strcmp(token, "")) { @@ -210,8 +203,7 @@ static size_t history_l_handler(void *contents, size_t size, size_t nmemb = malloc(strlen(token)); strcpy(ticket_history->new_value , ++token); - } else - ticket_history->new_value = NULL; + } } else if (!strcmp(token, "Data")) { token = strtok_r(NULL, ":", &tokensaveptr); if (token && strcmp(token, "")) { @@ -219,8 +211,7 @@ static size_t history_l_handler(void *contents, size_t size, size_t nmemb = 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 -- cgit v1.2.3