From f136728d78e10411618a0c26104413a035d35fe2 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Sun, 6 Oct 2024 12:02:59 +0200 Subject: [PATCH] fix(parse): guard not to add empty arg --- src/parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parse.c b/src/parse.c index fc3bdc5..fdafa3d 100644 --- a/src/parse.c +++ b/src/parse.c @@ -32,7 +32,9 @@ void parse_worker(struct Args *args, char *arg_position, } return; } else if (isspace(line[0])) { - add_arg(args, arg_position, arg_length); + if (arg_length != 0) { + add_arg(args, arg_position, arg_length); + } while (line[0] != '\n' && isspace(line[0])) { line++; }