LCMapStringA: if dstlen is insufficient, return

ERROR_INSUFFICIENT_BUFFER (verified).
This commit is contained in:
Marcus Meissner 1999-01-20 14:13:02 +00:00 committed by Alexandre Julliard
parent ae0a73d442
commit af88f578ab
1 changed files with 8 additions and 5 deletions

View File

@ -2042,9 +2042,10 @@ INT32 WINAPI LCMapString32A(
if (dstlen==0)
return srclen; /* dstlen=0 means "do nothing but return required length" */
if (dstlen<srclen)
srclen=dstlen; /* No, this case is not an error under Windows 95.
And no '\0' gets written. */
if (dstlen<srclen) {
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return 0;
}
if (mapflags & LCMAP_UPPERCASE)
f = toupper;
else if (mapflags & LCMAP_LOWERCASE)
@ -2227,8 +2228,10 @@ INT32 WINAPI LCMapString32W(
if (dstlen==0)
return srclen;
if (dstlen<srclen)
if (dstlen<srclen) {
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return 0;
}
if (mapflags & LCMAP_UPPERCASE)
f = toupper;
else if (mapflags & LCMAP_LOWERCASE)