[libc] Fix index into argument vector

This commit is contained in:
Joseph Huber 2024-08-06 14:06:17 -05:00
parent a1af1de438
commit 2e9f15e1df

View File

@ -85,7 +85,7 @@ void *copy_argument_vector(int argc, const char **argv, Allocator alloc) {
}
// Ensure the vector is null terminated.
reinterpret_cast<void **>(dev_argv)[argc + 1] = nullptr;
reinterpret_cast<void **>(dev_argv)[argc] = nullptr;
return dev_argv;
}