diff options
-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; |