]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0458: Coverity complains about division by zero v9.1.0458
authorChristian Brabandt <cb@256bit.org>
Sun, 2 Jun 2024 14:04:43 +0000 (16:04 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 2 Jun 2024 14:04:43 +0000 (16:04 +0200)
Problem:  Coverity complains about division by zero
Solution: Check explicitly for sw_val being zero

Shouldn't happen, since tabstop value should always be larger than zero.
So just add this as a safety measure.

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ops.c
src/version.c

index fea021b93eaca0f057127d6852535ffff1b4db43..b9569571ef917f9eb968bdfd2961485c53dd8b48 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -233,6 +233,9 @@ shift_line(
     int                i, j;
     int                sw_val = trim_to_int(get_sw_value_indent(curbuf, left));
 
+    if (sw_val == 0)
+       sw_val = 1;             // shouldn't happen, just in case
+
     count = get_indent();      // get current indent
 
     if (round)                 // round off indent
index 221fcf8c72d59d257e43f9bca75d232fe7d39b55..068c0793c1bcd55feec2ee6ae04611ff03975830 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    458,
 /**/
     457,
 /**/