[PATCH] fdo#42492: fixing Basic HEX command
Noel Power
nopower at suse.com
Tue Jul 31 02:08:47 PDT 2012
On 31/07/12 07:13, János Uray wrote:
> The patch solves this bug:
> https://bugs.freedesktop.org/show_bug.cgi?id=42492
> There was a buffer overflow: char aBuffer[16] had no room for the
> terminating null character.
> But the hex command was still wrong, because the printf used "%X" and
> "%lX", which are very platform-dependent.
> Actually the "integer" is only 16-bit, and "long" is only 32-bit. I've
> corrected this by using "%"SAL_PRIXUINT32 as described in
> http://wiki.documentfoundation.org/Development/Sal_Types (and there is
> no SAL_PRIXUINT16, so both were converted to sal_uInt32).
hmm, not looking at the patch in detail yet I am not sure if a length of
16 is sensible, if the size of the type for the hex output is 2
(integer) or 4 bytes (long) I would expect the max display from HEX to
be FFFF or FFFFFFFF respectively :/ I'd like to see what MS vba does
here, we should try to remain compatible if possible.
Noel
More information about the LibreOffice
mailing list