Kaydet (Commit) f0dff0d9 authored tarafından Christian Lohmaier's avatar Christian Lohmaier

use non-const buffer to enable byte-order swapping on BigEndian system

üst cb9dad87
...@@ -129,7 +129,14 @@ BinaryOutputStream::writeUnicodeArray( const ::rtl::OUString& rString, bool bAll ...@@ -129,7 +129,14 @@ BinaryOutputStream::writeUnicodeArray( const ::rtl::OUString& rString, bool bAll
OUString sBuf( rString ); OUString sBuf( rString );
if( !bAllowNulChars ) if( !bAllowNulChars )
sBuf.replace( '\0', '?' ); sBuf.replace( '\0', '?' );
#ifdef OSL_BIGENDIAN
// need a non-const buffer for swapping byte order
sal_Unicode notConst[sBuf.getLength()];
memcpy( notConst, sBuf.getStr(), sizeof(sal_Unicode)*sBuf.getLength() );
writeArray( notConst, sBuf.getLength() );
#else
writeArray( sBuf.getStr(), sBuf.getLength() ); writeArray( sBuf.getStr(), sBuf.getLength() );
#endif
} }
void void
......
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