patch 9.1.0458: Coverity complains about division by zero

Commit: 
https://github.com/vim/vim/commit/7737ce519b9cba8ef135154d76b69f715b1a0b4d
Author: Christian Brabandt <c...@256bit.org>
Date:   Sun Jun 2 16:04:43 2024 +0200

    patch 9.1.0458: Coverity complains about division by zero
    
    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 <c...@256bit.org>

diff --git a/src/ops.c b/src/ops.c
index fea021b93..b9569571e 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 221fcf8c7..068c0793c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    458,
 /**/
     457,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1sDlzE-005Z1U-TO%40256bit.org.

Raspunde prin e-mail lui