appwiz.cpl: Simplify the check for an empty string (PVS-Studio).

This commit is contained in:
Michael Stefaniuc 2014-11-14 10:51:38 +01:00 committed by Alexandre Julliard
parent 3a7bf90f66
commit bbff30f30e

View File

@ -567,7 +567,7 @@ static void SetInfoDialogText(HKEY hKey, LPCWSTR lpKeyName, LPCWSTR lpAltMessage
/* if hKey is null, lpKeyName contains the string we want to check */ /* if hKey is null, lpKeyName contains the string we want to check */
if (hKey == NULL) if (hKey == NULL)
{ {
if ((lpKeyName) && (lstrlenW(lpKeyName) > 0)) if (lpKeyName && lpKeyName[0])
SetWindowTextW(hWndDlgItem, lpKeyName); SetWindowTextW(hWndDlgItem, lpKeyName);
else else
SetWindowTextW(hWndDlgItem, lpAltMessage); SetWindowTextW(hWndDlgItem, lpAltMessage);
@ -577,7 +577,7 @@ static void SetInfoDialogText(HKEY hKey, LPCWSTR lpKeyName, LPCWSTR lpAltMessage
buflen = MAX_STRING_LEN; buflen = MAX_STRING_LEN;
if ((RegQueryValueExW(hKey, lpKeyName, 0, 0, (LPBYTE) buf, &buflen) == if ((RegQueryValueExW(hKey, lpKeyName, 0, 0, (LPBYTE) buf, &buflen) ==
ERROR_SUCCESS) && (lstrlenW(buf) > 0)) ERROR_SUCCESS) && buf[0])
SetWindowTextW(hWndDlgItem, buf); SetWindowTextW(hWndDlgItem, buf);
else else
SetWindowTextW(hWndDlgItem, lpAltMessage); SetWindowTextW(hWndDlgItem, lpAltMessage);