[PATCH] fixed error reporting of add_streams_to_table

Marcus Meissner marcus at jet.franken.de
Fri Feb 15 14:14:22 CST 2008


Hi,

add_streams_to_table can return -1 , so it probably should
return INT instead of UINT. But since num_rows is also unsigned,
just store the value in a temporary integer and check it.

Ciao, Marcus
---
 dlls/msi/streams.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/streams.c b/dlls/msi/streams.c
index 9950270..3d91b9b 100644
--- a/dlls/msi/streams.c
+++ b/dlls/msi/streams.c
@@ -439,7 +439,7 @@ static const MSIVIEWOPS streams_ops =
     NULL,
 };
 
-static UINT add_streams_to_table(MSISTREAMSVIEW *sv)
+static INT add_streams_to_table(MSISTREAMSVIEW *sv)
 {
     IEnumSTATSTG *stgenum = NULL;
     STATSTG stat;
@@ -498,6 +498,7 @@ static UINT add_streams_to_table(MSISTREAMSVIEW *sv)
 UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view)
 {
     MSISTREAMSVIEW *sv;
+    INT rows;
 
     TRACE("(%p, %p)\n", db, view);
 
@@ -507,10 +508,10 @@ UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view)
 
     sv->view.ops = &streams_ops;
     sv->db = db;
-    sv->num_rows = add_streams_to_table(sv);
-
-    if (sv->num_rows < 0)
+    rows = add_streams_to_table(sv);
+    if (rows < 0)
         return ERROR_FUNCTION_FAILED;
+    sv->num_rows = rows;
 
     *view = (MSIVIEW *)sv;
 
-- 
1.5.2.4



More information about the wine-patches mailing list