summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-07-31 14:25:29 +0100
committerNoel Power <noel.power@novell.com>2012-07-31 14:27:42 +0100
commit02a7dfb729799f9e1437a718951566640d0fde02 (patch)
treeda10bb53a5221611aef60bc5f582512b2e5f367e
parent556720fcdd419820814164ecafbedb6598b5bb20 (diff)
tweak for commit 8181dddb7bf166be4a00e9280d52f8d7a1741290 fdo#42492
avoid char buffer and snprintf. Change-Id: Ia83cfc9333591bcb3b191679ccf2be587b4be243
-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 06f319ce4bc6..c8d8c0fbdcd7 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -861,14 +861,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 ) );
}
}