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:
parent
8c7266009c
commit
64eed99f8e
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue