From ab08c615c706cb95fe95ad83c108856a03be2384 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, 18 Sep 2019 21:12:19 +0800 Subject: Prepend the new ticket content --- ticket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ticket.c b/ticket.c index 06a1fb3..cd1cd7f 100644 --- a/ticket.c +++ b/ticket.c @@ -19,7 +19,7 @@ void rtclient_ticket_new(const char *queue , const char *due , const char *text) { - size_t length = 0; + size_t length = strlen("id: ticket/new\n"); if (queue && strcmp(queue, "")) length += strlen("Queue: \n") + strlen(queue); if (requestor && strcmp(requestor, "")) @@ -50,7 +50,7 @@ void rtclient_ticket_new(const char *queue length += strlen("Text: \n") + strlen(text); char content[length + 1]; - memset(content, 0, strlen(content)); + strcpy(content, "id: ticket/new\n"); if (queue && strcmp(queue, "")) sprintf(content, "%sQueue: %s\n", content, queue); if (requestor && strcmp(requestor, "")) -- cgit v1.2.3