mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Fix warnings: shell.c: do_os_system(): Nonnull passed null: FP. #2923
Problem : Argument with 'nonnull' attribute passed null @ 203. Diagnostic : False positive. Rationale : Problem is supposed to appear when argv[0] is NULL within do_os_system. But argv is being generated by shell_build_argv(), which implies argv[0] is the current value for 'shell' option. Now, option has a non-null default ($SHELL or "sh"), and, if set by the user, it can be empty, but not NULL. So, argv[0] can never be NULL. Resolution : Assert shell_build_argv() postcondition.
This commit is contained in:
parent
957c81539f
commit
f77f644998
@ -63,6 +63,8 @@ char **shell_build_argv(const char *cmd, const char *extra_args)
|
|||||||
|
|
||||||
rv[i] = NULL;
|
rv[i] = NULL;
|
||||||
|
|
||||||
|
assert(rv[0]);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user