Fix error handling in dlls/msi/table.c

Gerald Pfeifer gerald at pfeifer.com
Wed Dec 26 15:44:22 CST 2007


utf2mime() returns an int, and indeed uses -1 as an error value.  The 
current code in encode_streamname() is broken in that it assigns the 
result of utf2mime() to a variable with an unsigned type and then uses
a comparison against 0 -- which is always true for an unsigned type --
to check for success.

Gerald

ChangeLog:
Fix error handling in encode_streamname().

Index: dlls/msi/table.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/table.c,v
retrieving revision 1.134
diff -u -3 -p -r1.134 table.c
--- dlls/msi/table.c	26 Dec 2007 16:06:32 -0000	1.134
+++ dlls/msi/table.c	26 Dec 2007 21:40:17 -0000
@@ -189,7 +189,7 @@ LPWSTR encode_streamname(BOOL bTable, LP
             if( next && (next<0x80) )
             {
                 next = utf2mime(next);
-                if( next >= 0  )
+                if( next != -1 )
                 {
                      next += 0x3ffffc0;
                      ch += (next<<6);



More information about the wine-patches mailing list