diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-06-28 19:34:53 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-06-28 14:45:13 -0400 |
commit | f77f64499830988a14c029bb6436afa4a4386d1e (patch) | |
tree | a69789719e970ee8149ebc6dad2ae086fefbfe22 /src | |
parent | 957c81539f9be2654fdb89c319c835bdf1a2ef60 (diff) | |
download | rneovim-f77f64499830988a14c029bb6436afa4a4386d1e.tar.gz rneovim-f77f64499830988a14c029bb6436afa4a4386d1e.tar.bz2 rneovim-f77f64499830988a14c029bb6436afa4a4386d1e.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/os/shell.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 5859254c1b..2de3b1aeed 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -63,6 +63,8 @@ char **shell_build_argv(const char *cmd, const char *extra_args) rv[i] = NULL; + assert(rv[0]); + return rv; } |