Commit 5bd1b6f4 authored by Andrey Gusev's avatar Andrey Gusev Committed by Alexandre Julliard

msi: Remove checks for negative value.

parent 52e27fae
......@@ -242,7 +242,7 @@ static WCHAR *deformat_file( FORMAT *format, FORMSTR *str, BOOL shortname, int *
if ((ret = strdupW( file->TargetPath ))) len = strlenW( ret );
goto done;
}
if ((len = GetShortPathNameW(file->TargetPath, NULL, 0)) <= 0)
if (!(len = GetShortPathNameW(file->TargetPath, NULL, 0)))
{
if ((ret = strdupW( file->TargetPath ))) len = strlenW( ret );
goto done;
......
......@@ -233,7 +233,7 @@ static void set_st_entry( string_table *st, UINT n, WCHAR *str, int len, USHORT
static UINT string2id( const string_table *st, const char *buffer, UINT *id )
{
DWORD sz;
int sz;
UINT r = ERROR_INVALID_PARAMETER;
LPWSTR str;
......@@ -245,8 +245,7 @@ static UINT string2id( const string_table *st, const char *buffer, UINT *id )
return ERROR_SUCCESS;
}
sz = MultiByteToWideChar( st->codepage, 0, buffer, -1, NULL, 0 );
if( sz <= 0 )
if (!(sz = MultiByteToWideChar( st->codepage, 0, buffer, -1, NULL, 0 )))
return r;
str = msi_alloc( sz*sizeof(WCHAR) );
if( !str )
......
......@@ -1279,9 +1279,7 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT
UINT r;
int ival;
if ( (iField <= 0) ||
(iField > tv->num_cols) ||
MSI_RecordIsNull( rec, iField ) )
if (!iField || iField > tv->num_cols || MSI_RecordIsNull( rec, iField ))
return ERROR_FUNCTION_FAILED;
columninfo = tv->columns[ iField - 1 ];
......
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