summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-07-31 14:25:29 +0100
committerAndras Timar <atimar@suse.com>2012-08-10 21:51:48 +0200
commitb0aac2a42566185dd9809e8ded8231a2162bfcba (patch)
treeeca7b8e9dad476ddfb14add97facdfd1df25e893
parent8f08ad4deeb0e5bce7a137ff1d678b71ce74377a (diff)
tweak for commit 8181dddb7bf166be4a00e9280d52f8d7a1741290 fdo#42492
avoid char buffer and snprintf. Change-Id: Ia83cfc9333591bcb3b191679ccf2be587b4be243 Signed-off-by: Andras Timar <atimar@suse.com>
-rw-r--r--basic/source/runtime/methods.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 49ebf27877b8..d54c5063fe8f 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -872,14 +872,12 @@ RTLFUNC(Hex)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- char aBuffer[17];
SbxVariableRef pArg = rPar.Get( 1 );
- // converting value to unsigned
+ // converting value to unsigned and limit to 2 or 4 byte representation
sal_uInt32 nVal = pArg->IsInteger() ?
static_cast<sal_uInt16>(pArg->GetInteger()) :
static_cast<sal_uInt32>(pArg->GetLong());
- snprintf( aBuffer, sizeof(aBuffer), "%"SAL_PRIXUINT32, nVal );
- rPar.Get(0)->PutString( rtl::OUString::createFromAscii( aBuffer ) );
+ rPar.Get(0)->PutString( rtl::OUString::valueOf( sal_Int64(nVal), 16 ) );
}
}