aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/memfile.c2
-rw-r--r--src/nvim/winfloat.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c
index e7b23021dd..8869a428d1 100644
--- a/src/nvim/memfile.c
+++ b/src/nvim/memfile.c
@@ -391,7 +391,7 @@ int mf_sync(memfile_T *mfp, int flags)
// Then we only try to write blocks within the existing file. If that also
// fails then we give up.
int status = OK;
- bhdr_T *hp;
+ bhdr_T *hp = NULL;
// note, "last" block is typically earlier in the hash list
map_foreach_value(&mfp->mf_hash, hp, {
if (((flags & MFS_ALL) || hp->bh_bnum >= 0)
diff --git a/src/nvim/winfloat.c b/src/nvim/winfloat.c
index c732ad09ed..693f9cf1e6 100644
--- a/src/nvim/winfloat.c
+++ b/src/nvim/winfloat.c
@@ -240,7 +240,9 @@ void win_float_remove(bool bang, int count)
for (win_T *wp = lastwin; wp && wp->w_floating; wp = wp->w_prev) {
kv_push(float_win_arr, wp);
}
- qsort(float_win_arr.items, float_win_arr.size, sizeof(win_T *), float_zindex_cmp);
+ if (float_win_arr.size > 0) {
+ qsort(float_win_arr.items, float_win_arr.size, sizeof(win_T *), float_zindex_cmp);
+ }
for (size_t i = 0; i < float_win_arr.size; i++) {
if (win_close(float_win_arr.items[i], false, false) == FAIL) {
break;