diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-04-27 05:26:25 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-02 21:49:17 +0000 |
commit | 0e8b30097a034d6b4bc734de2892ac5917a5bb9d (patch) | |
tree | 8c85d39115a10582ecad96943ce2b6eed745769c /ext | |
parent | 0e41cd871c178c65afa4b4a7cea4d1df2def8588 (diff) | |
download | perl-0e8b30097a034d6b4bc734de2892ac5917a5bb9d.tar.gz |
Dump UVs as UVs in Data::Dumper.
Subject: Re: [ID 20000405.018] Data::Dumper and negative numbers
Message-Id: <200004271926.MAA04331@molotok.activestate.com>
p4raw-id: //depot/perl@6494
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Data/Dumper/Dumper.xs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index bb606f42ca..6df47a5650 100644 --- a/ext/Data/Dumper/Dumper.xs +++ b/ext/Data/Dumper/Dumper.xs @@ -584,7 +584,10 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv, if (SvIOK(val)) { STRLEN len; - (void) sprintf(tmpbuf, "%"IVdf, SvIV(val)); + if (SvIsUV(val)) + (void) sprintf(tmpbuf, "%"UVdf, SvUV(val)); + else + (void) sprintf(tmpbuf, "%"IVdf, SvIV(val)); len = strlen(tmpbuf); sv_catpvn(retval, tmpbuf, len); } |