mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 08:50:24 +08:00
[MMSYS] Don't compare array against NULL
Fixes GCC 13 warning:
C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c: In function 'ShowSoundScheme':
C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c:995:17: error: the comparison will always evaluate as 'true' for the address of 'szValue' will never be NULL [-Werror=address]
995 | if (pLabelContext->szValue && wcslen(pLabelContext->szValue) > 0)
| ^~~~~~~~~~~~~
C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c:44:11: note: 'szValue' declared here
44 | WCHAR szValue[MAX_PATH];
| ^~~~~~~
This commit is contained in:
@@ -992,7 +992,7 @@ ShowSoundScheme(PGLOBAL_DATA pGlobalData, HWND hwndDlg)
|
||||
tvItem.item.state = TVIS_EXPANDED;
|
||||
tvItem.item.stateMask = TVIS_EXPANDED;
|
||||
tvItem.item.pszText = pLabelMap->szDesc;
|
||||
if (pLabelContext->szValue && wcslen(pLabelContext->szValue) > 0)
|
||||
if (pLabelContext && wcslen(pLabelContext->szValue) > 0)
|
||||
{
|
||||
tvItem.item.iImage = IMAGE_SOUND_ASSIGNED;
|
||||
tvItem.item.iSelectedImage = IMAGE_SOUND_ASSIGNED;
|
||||
@@ -1002,7 +1002,7 @@ ShowSoundScheme(PGLOBAL_DATA pGlobalData, HWND hwndDlg)
|
||||
tvItem.item.iImage = IMAGE_SOUND_NONE;
|
||||
tvItem.item.iSelectedImage = IMAGE_SOUND_NONE;
|
||||
}
|
||||
tvItem.item.lParam = (LPARAM)FindLabelContext(pGlobalData, pScheme, pAppMap->szName, pLabelMap->szName);
|
||||
tvItem.item.lParam = (LPARAM)pLabelContext;
|
||||
|
||||
TreeView_InsertItem(hList, &tvItem);
|
||||
|
||||
@@ -1433,7 +1433,7 @@ SoundsDlgProc(HWND hwndDlg,
|
||||
break;
|
||||
}
|
||||
|
||||
if (_wcsicmp(pLabelContext->szValue, (PWSTR)lResult) || (lIndex != pLabelContext->szValue[0]))
|
||||
if (pLabelContext && (_wcsicmp(pLabelContext->szValue, (PWSTR)lResult) || (lIndex != pLabelContext->szValue[0])))
|
||||
{
|
||||
/* Update the tree view item image */
|
||||
item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
|
||||
|
||||
Reference in New Issue
Block a user