fix(parse): guard not to add empty arg

This commit is contained in:
Ahurac 2024-10-06 12:02:59 +02:00
parent e5aa953c04
commit f136728d78

View file

@ -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++;
}