0
0
mirror of https://github.com/vim/vim.git synced 2025-07-24 10:45:12 -04:00

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 <cb@256bit.org>
This commit is contained in:
Christian Brabandt 2024-06-02 16:04:43 +02:00
parent e5bc2e4bc9
commit 7737ce519b
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
458,
/**/
457,
/**/