PATCH: gdbproxy new compiler

Marcus Meissner marcus at jet.franken.de
Sun Aug 1 04:24:53 CDT 2004


Hi,

The new compiler warned:
gdbproxy.c: In function `packet_read_memory':
gdbproxy.c:932: warning: comparisons like X<=Y<=Z do not have their mathematical meaning

This should be the correct handling of len / nread, I hope.

Ciao, Marcus

Changelog:
	Replaced undefined C expression.

Index: programs/winedbg/gdbproxy.c
===================================================================
RCS file: /home/wine/wine/programs/winedbg/gdbproxy.c,v
retrieving revision 1.18
diff -u -r1.18 gdbproxy.c
--- programs/winedbg/gdbproxy.c	4 Jun 2004 00:59:16 -0000	1.18
+++ programs/winedbg/gdbproxy.c	1 Aug 2004 09:23:25 -0000
@@ -927,9 +927,10 @@
     assert(gdbctx->in_trap);
     /* FIXME:check in_packet_len for reading %p,%x */
     if (sscanf(gdbctx->in_packet, "%p,%x", &addr, &len) != 2) return packet_error;
+    if (len <= 0) return packet_error;
     if (gdbctx->trace & GDBPXY_TRC_COMMAND)
         fprintf(stderr, "Read mem at %p for %u bytes\n", addr, len);
-    for (nread = 0; nread < len > 0; nread += r, addr += r)
+    for (nread = 0; nread < len; nread += r, addr += r)
     {
         blk_len = min(sizeof(buffer), len - nread);
         if (!ReadProcessMemory(gdbctx->process->handle, addr, buffer, blk_len, &r) ||
-- 



More information about the wine-patches mailing list