Jinoh Kang : winedbg: Use unsigned int for offset/length in GDB qXfer handler.

Alexandre Julliard julliard at winehq.org
Fri Nov 19 15:45:33 CST 2021


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

Author: Jinoh Kang <jinoh.kang.kr at gmail.com>
Date:   Fri Nov 19 22:41:12 2021 +0900

winedbg: Use unsigned int for offset/length in GDB qXfer handler.

packet_query uses sscanf format "%x" to parse out offset and length
values.  Since %x corresponds to unsigned int in the C standard, adjust
the variable types appropriately.

Signed-off-by: Jinoh Kang <jinoh.kang.kr at gmail.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/winedbg/gdbproxy.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index d3055340ead..727b24c9adf 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -772,7 +772,7 @@ static void packet_reply_open_xfer(struct gdb_context* gdbctx)
     packet_reply_add(gdbctx, "m");
 }
 
-static void packet_reply_close_xfer(struct gdb_context* gdbctx, int off, int len)
+static void packet_reply_close_xfer(struct gdb_context* gdbctx, unsigned int off, unsigned int len)
 {
     int begin = gdbctx->out_curr_packet + 1;
     int plen;
@@ -789,7 +789,7 @@ static void packet_reply_close_xfer(struct gdb_context* gdbctx, int off, int len
     }
 
     plen = gdbctx->out_len - begin;
-    if (len >= 0 && plen > len) gdbctx->out_len -= (plen - len);
+    if (plen > len) gdbctx->out_len -= (plen - len);
     else gdbctx->out_buf[gdbctx->out_curr_packet] = 'l';
 
     packet_reply_close(gdbctx);
@@ -1762,7 +1762,7 @@ static void packet_query_target_xml(struct gdb_context* gdbctx, struct backend_c
 
 static enum packet_return packet_query(struct gdb_context* gdbctx)
 {
-    int off, len;
+    unsigned int off, len;
     struct backend_cpu *cpu;
 
     switch (gdbctx->in_packet[0])




More information about the wine-cvs mailing list