From 90b16320f2d9f077cb58830cb1c93fbde7b6e34e Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 24 Oct 2010 16:23:05 +0200 Subject: [PATCH] Refactor B::hash to use Perl_newSVpvf() instead of my_sprintf() and new_SVpvn*. --- ext/B/B.xs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/B/B.xs b/ext/B/B.xs index 138ec05..28ad952 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -781,11 +781,9 @@ hash(sv) CODE: STRLEN len; U32 hash = 0; - char hexhash[19]; /* must fit "0xffffffffffffffff" plus trailing \0 */ const char *s = SvPV(sv, len); PERL_HASH(hash, s, len); - len = my_sprintf(hexhash, "0x%"UVxf, (UV)hash); - ST(0) = newSVpvn_flags(hexhash, len, SVs_TEMP); + ST(0) = sv_2mortal(Perl_newSVpvf(aTHX_ "0x%"UVxf, (UV)hash)); #define cast_I32(foo) (I32)foo IV -- 2.7.4