aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2020-03-03 00:08:48 -0800
committerJustin M. Keyes <justinkz@gmail.com>2020-03-03 00:26:21 -0800
commitf8f41d088b2b7b503f638ce8930bedb32c0d32c5 (patch)
tree7dc474ef007accd2b9cbcadc08d10d24994114c7 /src/nvim/diff.c
parentfbc4c4fd36bef6f10f75af675985167d5fab4699 (diff)
downloadrneovim-f8f41d088b2b7b503f638ce8930bedb32c0d32c5.tar.gz
rneovim-f8f41d088b2b7b503f638ce8930bedb32c0d32c5.tar.bz2
rneovim-f8f41d088b2b7b503f638ce8930bedb32c0d32c5.zip
diff.c: fix sprintf call
fix #11975
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index b8603c27d2..f8b7592d0b 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -1395,7 +1395,8 @@ void diff_win_options(win_T *wp, int addbuf)
}
xfree(wp->w_p_fdc);
wp->w_p_fdc = (char_u *)xstrdup("2");
- snprintf((char *)wp->w_p_fdc, sizeof(wp->w_p_fdc), "%d", diff_foldcolumn);
+ assert(diff_foldcolumn >= 0 && diff_foldcolumn <= 9);
+ snprintf((char *)wp->w_p_fdc, STRLEN(wp->w_p_fdc) + 1, "%d", diff_foldcolumn);
wp->w_p_fen = true;
wp->w_p_fdl = 0;
foldUpdateAll(wp);