aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/memline.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index 8b5aef3be1..02a7e1f697 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -1548,6 +1548,7 @@ static bool swapfile_unchanged(char *fname)
char hostname[B0_HNAME_SIZE];
os_get_hostname(hostname, B0_HNAME_SIZE);
hostname[B0_HNAME_SIZE - 1] = NUL;
+ b0.b0_hname[B0_HNAME_SIZE - 1] = NUL; // in case of corruption
if (STRICMP(b0.b0_hname, hostname) != 0) {
ret = false;
}