Perl_is_utf8_string(pTHX_ U8 *s, STRLEN len)
authorNick Ing-Simmons <nik@tiuk.ti.com>
Mon, 12 Jul 2004 12:17:56 +0000 (12:17 +0000)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Mon, 12 Jul 2004 12:17:56 +0000 (12:17 +0000)
Can now handle the case
     is_utf8_string(NULL,0)
again.
Why do we have code dup for Perl_is_utf8_string_loc() ?

p4raw-id: //depot/perl@23083

utf8.c

diff --git a/utf8.c b/utf8.c
index 6f201a2..6155fab 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -232,7 +232,7 @@ Perl_is_utf8_string(pTHX_ U8 *s, STRLEN len)
     U8* send;
     STRLEN c;
 
-    if (!len)
+    if (!len && s)
        len = strlen((char *)s);
     send = s + len;
 
@@ -272,7 +272,7 @@ Perl_is_utf8_string_loc(pTHX_ U8 *s, STRLEN len, U8 **p)
     U8* send;
     STRLEN c;
 
-    if (!len)
+    if (!len && s)
        len = strlen((char *)s);
     send = s + len;