https://git.reactos.org/?p=reactos.git;a=commitdiff;h=306890e8c4be236743c62…
commit 306890e8c4be236743c625ea971ed5079a994cd1
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 16:59:15 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:56 2022 +0100
[WINESYNC] msi: Remove checks for negative value.
Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 5bd1b6f41032d1e133a8d9a96fba711ee491d634 by Andrey Gusev
<andrey.goosev(a)gmail.com>
---
dll/win32/msi/format.c | 2 +-
dll/win32/msi/string.c | 5 ++---
dll/win32/msi/table.c | 4 +---
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/dll/win32/msi/format.c b/dll/win32/msi/format.c
index 6165f0a5dfd..06addd84741 100644
--- a/dll/win32/msi/format.c
+++ b/dll/win32/msi/format.c
@@ -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;
diff --git a/dll/win32/msi/string.c b/dll/win32/msi/string.c
index f094a53c9e6..7383fddbed3 100644
--- a/dll/win32/msi/string.c
+++ b/dll/win32/msi/string.c
@@ -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 )
diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c
index 45a181445aa..e046c5c9e27 100644
--- a/dll/win32/msi/table.c
+++ b/dll/win32/msi/table.c
@@ -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 ];