From d0038f19a7cb23749588b72c9febcf114d9d31e9 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 8 Sep 2020 18:31:51 +0200 Subject: static hist, words fix --- src/p_args.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/p_args.c') diff --git a/src/p_args.c b/src/p_args.c index 383700f..78cfc06 100644 --- a/src/p_args.c +++ b/src/p_args.c @@ -116,9 +116,10 @@ static uint16_t if (ft_iswhitespace(*ptr) && p_meet_whitespace((char*)word, ptr, mode) == TRUE) { - count += 1; ptr = p_skip_whitespace(ptr); - start[count - 1] = (ptr - word); + start[count] = (ptr - word); + if (*ptr != C_NUL) + count += 1; ptr -= 1; } ptr++; -- cgit v1.2.3