summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2024-06-02 16:04:43 +0200
committerChristian Brabandt <cb@256bit.org>2024-06-02 16:04:43 +0200
commit7737ce519b9cba8ef135154d76b69f715b1a0b4d (patch)
treea522ee0bc8d9add75f8fb7dc8d9d753c90eaf9db
parente5bc2e4bc9e7456daef480dd422252dbf444c58c (diff)
patch 9.1.0458: Coverity complains about division by zerov9.1.0458
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>
-rw-r--r--src/ops.c3
-rw-r--r--src/version.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/ops.c b/src/ops.c
index fea021b93e..b9569571ef 100644
--- 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
diff --git a/src/version.c b/src/version.c
index 221fcf8c72..068c0793c1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 458,
+/**/
457,
/**/
456,