PATCH: tools/winegcc/utils.c -- casts

Gerald Pfeifer gerald at pfeifer.com
Thu Oct 30 02:26:30 CST 2003


Interestingly, Wine itself rarely shows this kind of problem, it's
mostly the tool/ directory.  Tested on SuSE Linux 8.2.

Gerald

ChangeLog:
Add proper casts to avoid signed vs. unsigned mismatches in strmake().
Index: utils.c
===================================================================
RCS file: /home/wine/wine/tools/winegcc/utils.c,v
retrieving revision 1.2
diff -u -3 -p -r1.2 utils.c
--- utils.c	15 Oct 2003 03:35:54 -0000	1.2
+++ utils.c	30 Oct 2003 08:19:17 -0000
@@ -79,8 +79,8 @@ char *strmake(const char *fmt, ...)
         va_start(ap, fmt);
 	n = vsnprintf (p, size, fmt, ap);
 	va_end(ap);
-        if (n > -1 && n < size) return p;
-	size = min( size*2, n+1 );
+        if (n > -1 && (size_t)n < size) return p;
+	size = min( size*2, (size_t)n+1 );
 	p = xrealloc (p, size);
     }
 }



More information about the wine-patches mailing list