From 1282ef9420bb0cc321829bf22d577f392d14612a Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Fri, 8 Feb 2002 17:10:49 +0000 Subject: [PATCH] Use the supplied buffer when copying item text. --- dlls/comctl32/comboex.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 508a592e287..a268c27e86c 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -329,8 +329,18 @@ static void COMBOEX_CopyItem (COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item, COMBOBOXEXITEMW *cit) { if (cit->mask & CBEIF_TEXT) { - cit->pszText = item->pszText; - cit->cchTextMax = item->cchTextMax; + /* + * when given a text buffer actually use that buffer + */ + if (cit->pszText) + { + lstrcpynW(cit->pszText,item->pszText,cit->cchTextMax); + } + else + { + cit->pszText = item->pszText; + cit->cchTextMax = item->cchTextMax; + } } if (cit->mask & CBEIF_IMAGE) cit->iImage = item->iImage;