diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-02 10:25:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-02 10:25:45 +0200 |
commit | 4ad739fc053c1666d07ba1cf59be26cb1c3e52d7 (patch) | |
tree | 66485dc142df679ab7c8091c2e6f14c7bc9608cb /src/viminfo.c | |
parent | 6f84b6db10ab86bca85e33f3fc6ee735eec8bbe5 (diff) | |
download | vim-git-4ad739fc053c1666d07ba1cf59be26cb1c3e52d7.tar.gz |
patch 8.2.1564: a few remaining errors from ubsanv8.2.1564
Problem: A few remaining errors from ubsan.
Solution: Avoid the warnings. (Dominique Pellé, closes #6837)
Diffstat (limited to 'src/viminfo.c')
-rw-r--r-- | src/viminfo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/viminfo.c b/src/viminfo.c index 74780c3d0..0ec9a1319 100644 --- a/src/viminfo.c +++ b/src/viminfo.c @@ -2183,7 +2183,8 @@ write_viminfo_filemarks(FILE *fp) xfmark_T *vi_fm; fm = idx >= 0 ? &curwin->w_jumplist[idx] : NULL; - vi_fm = vi_idx < vi_jumplist_len ? &vi_jumplist[vi_idx] : NULL; + vi_fm = (vi_jumplist != NULL && vi_idx < vi_jumplist_len) + ? &vi_jumplist[vi_idx] : NULL; if (fm == NULL && vi_fm == NULL) break; if (fm == NULL || (vi_fm != NULL && fm->time_set < vi_fm->time_set)) |