Commit 481ff775 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msi: Simplify check for an empty string (PVS-Studio).

parent e2eb760f
......@@ -2171,7 +2171,7 @@ static void msi_dialog_update_pathedit( msi_dialog *dialog, msi_control *control
/* FIXME: test when this should fail */
static BOOL msi_dialog_verify_path( LPWSTR path )
{
if ( !lstrlenW( path ) )
if ( !path[0] )
return FALSE;
if ( PathIsRelativeW( path ) )
......
......@@ -356,7 +356,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
if (FAILED(hr)) goto done;
/* Call a function if necessary through the IDispatch interface */
if (function != NULL && strlenW(function) > 0) {
if (function && function[0]) {
TRACE("Calling function %s\n", debugstr_w(function));
hr = IActiveScript_GetScriptDispatch(pActiveScript, NULL, &pDispatch);
......
......@@ -2715,7 +2715,7 @@ static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase
}
if (!expected)
ok_(__FILE__, line)(lstrlenA(val) == 0, "Expected empty string, got %s\n", val);
ok_(__FILE__, line)(!val[0], "Expected empty string, got %s\n", val);
else
{
if (bcase)
......
......@@ -4534,7 +4534,7 @@ static void test_update(void)
size = MAX_PATH;
r = MsiRecordGetStringA(rec, 1, result, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrlenA(result), "Expected an empty string, got %s\n", result);
ok(!result[0], "Expected an empty string, got %s\n", result);
MsiCloseHandle(rec);
......@@ -4580,7 +4580,7 @@ static void test_update(void)
size = MAX_PATH;
r = MsiRecordGetStringA(rec, 1, result, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrlenA(result), "Expected an empty string, got %s\n", result);
ok(!result[0], "Expected an empty string, got %s\n", result);
MsiCloseHandle(rec);
......
......@@ -2194,7 +2194,7 @@ static void test_props(void)
sz = 6;
r = MsiGetPropertyA(hpkg, "property", buffer, &sz);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok( !strlen(buffer), "Expected empty string, got %s\n", buffer);
ok(!buffer[0], "Expected empty string, got %s\n", buffer);
MsiCloseHandle( hpkg );
DeleteFileA(msifile);
......@@ -2347,7 +2347,7 @@ static void test_property_table(void)
lstrcpyA(buffer, "aaa");
r = MsiGetPropertyA(hpkg, "dantes", buffer, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(lstrlenA(buffer) == 0, "Expected empty string, got %s\n", buffer);
ok(!buffer[0], "Expected empty string, got %s\n", buffer);
r = MsiSetPropertyA(hpkg, "dantes", "mercedes");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
......
......@@ -176,7 +176,7 @@ static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase
}
if (!expected)
ok_(__FILE__, line)(lstrlenA(val) == 0, "Expected empty string, got %s\n", val);
ok_(__FILE__, line)(!val[0], "Expected empty string, got %s\n", val);
else
{
if (bcase)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment