Permalink
Browse files

toke.c: Use valid_utf8_length()

  • Loading branch information...
khwilliamson committed Dec 7, 2017
1 parent 9599338 commit 98981aeb4807d82d0b8e7d56335bc54597520909
Showing with 1 addition and 1 deletion.
  1. +1 −1 toke.c
View
2 toke.c
@@ -5229,7 +5229,7 @@ Perl_yylex(pTHX)
while (d > SvPVX(PL_linestr) && d[-1] && d[-1] != '\n')
--d;
}
len = UTF ? Perl_utf8_length(aTHX_ (U8 *) d, (U8 *) s) : (STRLEN) (s - d);
len = UTF ? valid_utf8_length((U8 *) d, (U8 *) s) : (STRLEN) (s - d);
if (len > UNRECOGNIZED_PRECEDE_COUNT) {
d = UTF ? (char *) utf8_hop_back((U8 *) s, -UNRECOGNIZED_PRECEDE_COUNT, (U8 *)d) : s - UNRECOGNIZED_PRECEDE_COUNT;
}

0 comments on commit 98981ae

Please sign in to comment.