diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-10-21 22:07:47 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-10-21 23:24:46 +0200 |
commit | a8422818a74b56ab42a92cbf3c044165657a4060 (patch) | |
tree | 6cb397dff12d4b2ddcaee14edd1a6ec0447c9304 /src/nvim/message.c | |
parent | e0f6f46c1b7ab486a84f2cfb8cda3e62035594aa (diff) | |
download | rneovim-a8422818a74b56ab42a92cbf3c044165657a4060.tar.gz rneovim-a8422818a74b56ab42a92cbf3c044165657a4060.tar.bz2 rneovim-a8422818a74b56ab42a92cbf3c044165657a4060.zip |
fix warning: null pointer dereference
Found by clang scan-build 5.0
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r-- | src/nvim/message.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index 1778e0048f..5dafde5bd1 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1475,11 +1475,13 @@ void msg_prt_line(char_u *s, int list) while (!got_int) { if (n_extra > 0) { - --n_extra; - if (c_extra) + n_extra--; + if (c_extra) { c = c_extra; - else + } else { + assert(p_extra != NULL); c = *p_extra++; + } } else if ((l = utfc_ptr2len(s)) > 1) { col += utf_ptr2cells(s); char buf[MB_MAXBYTES + 1]; |