diff options
author | Fredrik Thulin <fredrik@thulin.net> | 2016-05-30 14:50:45 +0200 |
---|---|---|
committer | Fredrik Thulin <fredrik@thulin.net> | 2016-05-30 14:50:45 +0200 |
commit | 565a5379d73a8492d247fdd41773096d83fbf941 (patch) | |
tree | 539b64046f75d7a6913faf0c984c2620a1786a83 /libcli.c | |
parent | 10893783fbcee4db76e620c7f2576cdddd0e9ef4 (diff) |
cli_parse_line: get rid of a lingering strdup
Diffstat (limited to 'libcli.c')
-rw-r--r-- | libcli.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |