This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mathoms.c: Use my_strnlen, not strnlen
authorKarl Williamson <khw@cpan.org>
Sat, 4 Aug 2018 14:28:51 +0000 (08:28 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 4 Aug 2018 15:48:23 +0000 (09:48 -0600)
Spotted by H. Merijn Brand.

mathoms.c

index 59d8aea..375e3e3 100644 (file)
--- a/mathoms.c
+++ b/mathoms.c
@@ -1662,7 +1662,7 @@ Perl_is_utf8_char(const U8 *s)
 
     /* Assumes we have enough space, which is why this is deprecated.  But the
      * strnlen() makes it safe for the common case of NUL-terminated strings */
-    return isUTF8_CHAR(s, s + strnlen((char *) s, UTF8SKIP(s)));
+    return isUTF8_CHAR(s, s + my_strnlen((char *) s, UTF8SKIP(s)));
 }
 
 /*