Fixed an error and an off-by-one bug in DSA_SetItem(). This

eliminates some crashes with Win98 native SHELL32.
This commit is contained in:
Ian Schmidt 1999-06-12 06:48:49 +00:00 committed by Alexandre Julliard
parent 8c7266009c
commit 64eed99f8e
1 changed files with 2 additions and 1 deletions

View File

@ -659,7 +659,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
/* within the old array */
if (hdsa->nMaxCount > nIndex) {
/* within the allocated space, set a new boundary */
hdsa->nItemCount = nIndex;
hdsa->nItemCount = nIndex + 1;
}
else {
/* resize the block of memory */
@ -672,6 +672,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
return FALSE;
hdsa->nMaxCount = nNewItems;
hdsa->nItemCount = nIndex + 1;
hdsa->pData = lpTemp;
}
}