xub_StrLen and >= 64k paragraphs

Eike Rathke erack at redhat.com
Thu Nov 28 14:03:03 PST 2013

Hi Caolán,

On Thursday, 2013-11-28 16:02:06 +0000, Caolán McNamara wrote:

> Do we want to return -1 or SAL_MAX_INT32 as the
> replacement. -1 is "nice" but there is so much code in existence that
> expects the error/boundary condition return value to be > any valid
> number that I reckon SAL_MAX_INT32 might be safer as the default.

I'd rather like to see a value (SAL_MAX_INT32-1) as replacement and name
it SAL_MAX_STRING or some such. Reason is there are/were places that
loop until <= STRING_MAXLEN and if the string really was that long
looped forever because it wrapped around 0xffff ... I'd like to avoid
situations where such could happen again and SAL_MAX_STRING+1 actually
is a value within the bounds of the type.


LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20131128/f8b2be6b/attachment.pgp>

More information about the LibreOffice mailing list