summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-06-10 10:52:52 -0600
committerKarl Williamson <khw@cpan.org>2022-06-10 11:02:05 -0600
commitafe34b1ad3e565e2ad0157c4b43a67b0d984c113 (patch)
tree99140ecf046c94a8e8502e6145acbf764b7bffe1 /toke.c
parent00a5df846e035280750985222a693ac58022ee36 (diff)
downloadperl-afe34b1ad3e565e2ad0157c4b43a67b0d984c113.tar.gz
toke.c: Remove Undefined C behavior
Spotted by clang 14.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index 2022c9bcf8..7eec8f9ada 100644
--- a/toke.c
+++ b/toke.c
@@ -12341,8 +12341,12 @@ S_scan_formline(pTHX_ char *s)
}
}
eol = (char *) memchr(s,'\n',PL_bufend-s);
- if (!eol++)
- eol = PL_bufend;
+ if (! eol) {
+ eol = PL_bufend;
+ }
+ else {
+ eol++;
+ }
if (*s != '#') {
char *t;
for (t = s; t < eol; t++) {