Francois Gouget : winedbg: Avoid unneeded strlen() calls.

Alexandre Julliard julliard at winehq.org
Mon Dec 9 16:57:37 CST 2019


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

Author: Francois Gouget <fgouget at free.fr>
Date:   Mon Dec  9 09:47:45 2019 +0100

winedbg: Avoid unneeded strlen() calls.

Note that target_xml is an array and thus cannot be NULL.

Signed-off-by: Francois Gouget <fgouget at free.fr>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index b7f59ee05b..85ebc882a6 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -1615,7 +1615,7 @@ static enum packet_return packet_query(struct gdb_context* gdbctx)
             return packet_ok;
         if (strncmp(gdbctx->in_packet, "Supported", 9) == 0)
         {
-            if (strlen(target_xml))
+            if (*target_xml)
                 return packet_reply(gdbctx, "PacketSize=400;qXfer:features:read+");
             else
             {
@@ -1652,7 +1652,7 @@ static enum packet_return packet_query(struct gdb_context* gdbctx)
         }
         break;
     case 'X':
-        if (strlen(target_xml) && strncmp(gdbctx->in_packet, "Xfer:features:read:target.xml", 29) == 0)
+        if (*target_xml && strncmp(gdbctx->in_packet, "Xfer:features:read:target.xml", 29) == 0)
             return packet_reply(gdbctx, target_xml);
         break;
     }




More information about the wine-cvs mailing list