From 64eed99f8e58302d6b25d2a455ad03d319669d55 Mon Sep 17 00:00:00 2001 From: Ian Schmidt Date: Sat, 12 Jun 1999 06:48:49 +0000 Subject: [PATCH] Fixed an error and an off-by-one bug in DSA_SetItem(). This eliminates some crashes with Win98 native SHELL32. --- dlls/comctl32/comctl32undoc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/comctl32undoc.c b/dlls/comctl32/comctl32undoc.c index 49fd34a672a..25360204e6b 100644 --- a/dlls/comctl32/comctl32undoc.c +++ b/dlls/comctl32/comctl32undoc.c @@ -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; } }