diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/LexPerl.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx index 4b7c9878a..4853460bf 100644 --- a/src/LexPerl.cxx +++ b/src/LexPerl.cxx @@ -247,8 +247,9 @@ static bool styleCheckSubPrototype(Accessor &styler, unsigned int bk) static bool isMatch(const char *sref, char *s) { // match per-line delimiter - must kill trailing CR if CRLF - if (s[strlen(s) - 1] == '\r') - s[strlen(s) - 1] = '\0'; + int i = strlen(s); + if (i != 0 && s[i - 1] == '\r') + s[i - 1] = '\0'; return (strcmp(sref, s) == 0); } |