Hans Leidekker : msi: Fix comparison of table ids in TABLE_Exists.

Alexandre Julliard julliard at winehq.org
Wed Sep 8 13:32:13 CDT 2010


Module: wine
Branch: master
Commit: d8b58797982ff2b648106e96e74bb50e09763572
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d8b58797982ff2b648106e96e74bb50e09763572

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Sep  8 12:17:01 2010 +0200

msi: Fix comparison of table ids in TABLE_Exists.

---

 dlls/msi/table.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 6755496..464eced 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -988,8 +988,8 @@ done:
 /* try to find the table name in the _Tables table */
 BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name )
 {
-    UINT r, table_id = 0, i, count;
-    MSITABLE *table = NULL;
+    UINT r, table_id, i;
+    MSITABLE *table;
 
     static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0};
     static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0};
@@ -1012,10 +1012,11 @@ BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name )
         return FALSE;
     }
 
-    count = table->row_count;
-    for( i=0; i<count; i++ )
-        if( table->data[ i ][ 0 ] == table_id )
+    for( i = 0; i < table->row_count; i++ )
+    {
+        if( read_table_int( table->data, i, 0, db->bytes_per_strref ) == table_id )
             return TRUE;
+    }
 
     return FALSE;
 }




More information about the wine-cvs mailing list