summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorRobin Barker <RMBarker@cpan.org>2001-04-06 19:08:52 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-07 17:28:26 +0000
commit59bb58455c306b86a68fba97f3fcce0a1f372a01 (patch)
tree4b8d6810ca005b6fa222239599ffcc7548dc3867 /sv.c
parentb8fa94d833cd9fcbc2e9db4b24f4b6f366a204a4 (diff)
downloadperl-59bb58455c306b86a68fba97f3fcce0a1f372a01.tar.gz
isn't numeric warning
Message-Id: <200104061708.SAA06783@tempest.npl.co.uk> p4raw-id: //depot/perl@9613
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index a589e08d99..1737e8fcc8 100644
--- a/sv.c
+++ b/sv.c
@@ -1430,12 +1430,12 @@ S_not_a_number(pTHX_ SV *sv)
{
char tmpbuf[64];
char *d = tmpbuf;
- char *s;
char *limit = tmpbuf + sizeof(tmpbuf) - 8;
/* each *s can expand to 4 chars + "...\0",
i.e. need room for 8 chars */
- for (s = SvPVX(sv); *s && d < limit; s++) {
+ char *s, *end;
+ for (s = SvPVX(sv), end = s + SvCUR(sv); s < end && d < limit; s++) {
int ch = *s & 0xFF;
if (ch & 128 && !isPRINT_LC(ch)) {
*d++ = 'M';
@@ -1458,6 +1458,10 @@ S_not_a_number(pTHX_ SV *sv)
*d++ = '\\';
*d++ = '\\';
}
+ else if (ch == '\0') {
+ *d++ = '\\';
+ *d++ = '0';
+ }
else if (isPRINT_LC(ch))
*d++ = ch;
else {