diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-02 09:21:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-02 09:21:25 -0400 |
commit | cf6c23fb0f1e67484103da9fc583abfbc6e6db91 (patch) | |
tree | 69802c718938fb1d58560fc39f26784181b434b9 /src/nvim/ex_cmds2.c | |
parent | 3f7cd18c4a416ea8805ffee445ec90d703806c78 (diff) | |
parent | 4f3396e128b0a1820fbb7f8e138def0322571244 (diff) | |
download | rneovim-cf6c23fb0f1e67484103da9fc583abfbc6e6db91.tar.gz rneovim-cf6c23fb0f1e67484103da9fc583abfbc6e6db91.tar.bz2 rneovim-cf6c23fb0f1e67484103da9fc583abfbc6e6db91.zip |
Merge pull request #14273 from janlazo/clang-warnings
clang: resolve logic error and dead store warnings
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index c4c18c4324..cc0ec71627 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2535,7 +2535,7 @@ void ex_source(exarg_T *eap) static void cmd_source(char_u *fname, exarg_T *eap) { - if (*fname == NUL) { + if (eap != NULL && *fname == NUL) { cmd_source_buffer(eap); } else if (eap != NULL && eap->forceit) { // ":source!": read Normal mode commands @@ -2575,7 +2575,8 @@ static char_u *get_buffer_line(int c, void *cookie, int indent, bool do_concat) return (char_u *)xstrdup((const char *)curr_line); } -static void cmd_source_buffer(exarg_T *eap) +static void cmd_source_buffer(const exarg_T *eap) + FUNC_ATTR_NONNULL_ALL { GetBufferLineCookie cookie = { .curr_lnum = eap->line1, |