This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/ebcdic.pl: Fix bug in decoding some high code points
[perl5.git] / numeric.c
index f5fc1f6..db8197c 100644 (file)
--- a/numeric.c
+++ b/numeric.c
@@ -1560,7 +1560,7 @@ Perl_my_atof3(pTHX_ const char* orig, NV* value, const STRLEN len)
         /* strtold() accepts 0x-prefixed hex and in POSIX implementations,
            0b-prefixed binary numbers, which is backward incompatible
         */
-        if ((len == 0 || len >= 2) && *s == '0' &&
+        if ((len == 0 || len - (s-orig) >= 2) && *s == '0' &&
             (isALPHA_FOLD_EQ(s[1], 'x') || isALPHA_FOLD_EQ(s[1], 'b'))) {
             *value = 0;
             return (char *)s+1;
@@ -1763,7 +1763,7 @@ Perl_isinfnan(NV nv)
 }
 
 /*
-=for apidoc
+=for apidoc isinfnansv
 
 Checks whether the argument would be either an infinity or C<NaN> when used
 as a number, but is careful not to trigger non-numeric or uninitialized