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