diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-01 21:10:29 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-02 08:23:40 -0400 |
commit | 484370f2069c78ac902535766ca864a6bd1f58bb (patch) | |
tree | 79ae8c0a0d0892422c498467e6a9d3438fd07cfa /src | |
parent | ba3d626efb37fbd704c69eeea0fb6568fb53c7bf (diff) | |
download | rneovim-484370f2069c78ac902535766ca864a6bd1f58bb.tar.gz rneovim-484370f2069c78ac902535766ca864a6bd1f58bb.tar.bz2 rneovim-484370f2069c78ac902535766ca864a6bd1f58bb.zip |
clang/'Logic error': cmd_source_buffer() requires nonnull param
Diffstat (limited to 'src')
-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, |