summaryrefslogtreecommitdiffstats
path: root/src/cindent.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-16 18:06:15 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-16 18:06:15 +0100
commit60ae0e71490c97f2871a6344aca61cacf220f813 (patch)
tree0d121e2e77ddcdb1b5e37f5ca68d91d3dfdc899d /src/cindent.c
parent3c25a8617aad9860a1b179d40a183c638b3b70cc (diff)
patch 8.2.4968: reading past end of the line when C-indentingv8.2.4968
Problem: Reading past end of the line when C-indenting. Solution: Check for NUL.
Diffstat (limited to 'src/cindent.c')
-rw-r--r--src/cindent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cindent.c b/src/cindent.c
index ec88036eb1..2d47e641be 100644
--- a/src/cindent.c
+++ b/src/cindent.c
@@ -89,7 +89,7 @@ skip_string(char_u *p)
while (vim_isdigit(p[i - 1])) // '\000'
++i;
}
- if (p[i] == '\'') // check for trailing '
+ if (p[i - 1] != NUL && p[i] == '\'') // check for trailing '
{
p += i;
continue;