Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbeyj@wpi.edu>

Fixed HEADER_InsertItemA and HEADER_InsertItemW null pointer checking
to handle wide character strings properly.  Fix of our previous patch
for null pointer checking.
This commit is contained in:
Alexandre Julliard 1999-05-01 10:37:00 +00:00
parent 89fd2dd1e8
commit b1ee0461d7
1 changed files with 10 additions and 4 deletions

View File

@ -763,8 +763,11 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (phdi->mask & HDI_TEXT) {
if (!phdi->pszText) /* null pointer check */
phdi->pszText = "";
if (phdi->pszText != LPSTR_TEXTCALLBACKA) {
{
lpItem->pszText = COMCTL32_Alloc(sizeof(WCHAR));
lstrcpyAtoW(lpItem->pszText, "");
}
else if (phdi->pszText != LPSTR_TEXTCALLBACKA) {
len = lstrlenA (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyAtoW (lpItem->pszText, phdi->pszText);
@ -849,8 +852,11 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (phdi->mask & HDI_TEXT) {
if (!phdi->pszText) /* null pointer check */
phdi->pszText = "";
if (phdi->pszText != LPSTR_TEXTCALLBACKW) {
{
lpItem->pszText = COMCTL32_Alloc(sizeof(WCHAR));
lstrcpyAtoW(lpItem->pszText, "");
}
else if (phdi->pszText != LPSTR_TEXTCALLBACKW) {
len = lstrlenW (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyW (lpItem->pszText, phdi->pszText);