fix(parse): bug where args aren't null terminated
This commit is contained in:
parent
5b18608b26
commit
9c41981502
1 changed files with 1 additions and 0 deletions
|
@ -19,6 +19,7 @@ void add_arg(struct Args *args, char *arg_ptr, unsigned int arg_length) {
|
|||
|
||||
char *arg = malloc(arg_length + 1);
|
||||
strncpy(arg, arg_ptr, arg_length);
|
||||
arg[arg_length] = '\0';
|
||||
|
||||
args->argv[args->argc] = arg;
|
||||
args->argc++;
|
||||
|
|
Loading…
Reference in a new issue