From: Gurusamy Sarathy Date: Thu, 27 Apr 2000 12:26:25 +0000 (-0700) Subject: Dump UVs as UVs in Data::Dumper. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0e8b30097a034d6b4bc734de2892ac5917a5bb9d;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index bb606f4..6df47a5 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); }