summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 24dc69297b..f65c94fbc7 100644
--- a/utf8.c
+++ b/utf8.c
@@ -163,9 +163,13 @@ bool
Perl_is_utf8_string(pTHX_ U8 *s, STRLEN len)
{
U8* x = s;
- U8* send = s + len;
+ U8* send;
STRLEN c;
+ if (!len)
+ len = strlen(s);
+ send = s + len;
+
while (x < send) {
c = is_utf8_char(x);
if (!c)