Kaydet (Commit) 02a7dfb7 authored tarafından Noel Power's avatar Noel Power

tweak for commit 8181dddb7bf166be4a00e9280d52f8d7a1741290 fdo#42492

avoid char buffer and snprintf.

Change-Id: Ia83cfc9333591bcb3b191679ccf2be587b4be243
üst 556720fc
......@@ -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 ) );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment