Skip to content

Commit 306890e

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi: Remove checks for negative value.
Signed-off-by: Andrey Gusev <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 5bd1b6f41032d1e133a8d9a96fba711ee491d634 by Andrey Gusev <[email protected]>
1 parent a237138 commit 306890e

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

dll/win32/msi/format.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static WCHAR *deformat_file( FORMAT *format, FORMSTR *str, BOOL shortname, int *
242242
if ((ret = strdupW( file->TargetPath ))) len = strlenW( ret );
243243
goto done;
244244
}
245-
if ((len = GetShortPathNameW(file->TargetPath, NULL, 0)) <= 0)
245+
if (!(len = GetShortPathNameW(file->TargetPath, NULL, 0)))
246246
{
247247
if ((ret = strdupW( file->TargetPath ))) len = strlenW( ret );
248248
goto done;

dll/win32/msi/string.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static void set_st_entry( string_table *st, UINT n, WCHAR *str, int len, USHORT
233233

234234
static UINT string2id( const string_table *st, const char *buffer, UINT *id )
235235
{
236-
DWORD sz;
236+
int sz;
237237
UINT r = ERROR_INVALID_PARAMETER;
238238
LPWSTR str;
239239

@@ -245,8 +245,7 @@ static UINT string2id( const string_table *st, const char *buffer, UINT *id )
245245
return ERROR_SUCCESS;
246246
}
247247

248-
sz = MultiByteToWideChar( st->codepage, 0, buffer, -1, NULL, 0 );
249-
if( sz <= 0 )
248+
if (!(sz = MultiByteToWideChar( st->codepage, 0, buffer, -1, NULL, 0 )))
250249
return r;
251250
str = msi_alloc( sz*sizeof(WCHAR) );
252251
if( !str )

dll/win32/msi/table.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,9 +1279,7 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT
12791279
UINT r;
12801280
int ival;
12811281

1282-
if ( (iField <= 0) ||
1283-
(iField > tv->num_cols) ||
1284-
MSI_RecordIsNull( rec, iField ) )
1282+
if (!iField || iField > tv->num_cols || MSI_RecordIsNull( rec, iField ))
12851283
return ERROR_FUNCTION_FAILED;
12861284

12871285
columninfo = tv->columns[ iField - 1 ];

0 commit comments

Comments
 (0)