From 565a5379d73a8492d247fdd41773096d83fbf941 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Mon, 30 May 2016 14:50:45 +0200 Subject: cli_parse_line: get rid of a lingering strdup --- libcli.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libcli.c') diff --git a/libcli.c b/libcli.c index cdf895c..b069c28 100644 --- a/libcli.c +++ b/libcli.c @@ -540,8 +540,9 @@ static int cli_parse_line(const char *line, char *words[], int max_words) { if (*p == '|') { - if (!(words[nwords++] = strdup("|"))) - return 0; + *ptr = '|'; + words[nwords++] = ptr; + ptr += 1 + 1; /* buf is memset zero, so we just need to add +1 to get a null terminated word */ } else if (!isspace((unsigned char) *p)) word_start = p; -- cgit v1.2.3