Alexandre Julliard : rpcrt4: Fix tracing of non-conformant strings.

Alexandre Julliard julliard at winehq.org
Tue Apr 6 11:20:04 CDT 2010


Module: wine
Branch: master
Commit: 5728d6b402c7f5697e82573f19313b9b2e30073d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5728d6b402c7f5697e82573f19313b9b2e30073d

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Apr  5 21:58:06 2010 +0200

rpcrt4: Fix tracing of non-conformant strings.

---

 dlls/rpcrt4/ndr_marshall.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index ac72055..3b5a340 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -2405,20 +2405,18 @@ unsigned char *  WINAPI NdrNonConformantStringMarshall(PMIDL_STUB_MESSAGE pStubM
 
   if (*pFormat == RPC_FC_CSTRING)
   {
-    ULONG i;
+    ULONG i = 0;
     const char *str = (const char *)pMemory;
-    for (i = 0; i < maxsize && *str; i++, str++)
-        ;
+    while (i < maxsize && str[i]) i++;
     TRACE("string=%s\n", debugstr_an(str, i));
     pStubMsg->ActualCount = i + 1;
     esize = 1;
   }
   else if (*pFormat == RPC_FC_WSTRING)
   {
-    ULONG i;
+    ULONG i = 0;
     const WCHAR *str = (const WCHAR *)pMemory;
-    for (i = 0; i < maxsize && *str; i++, str++)
-        ;
+    while (i < maxsize && str[i]) i++;
     TRACE("string=%s\n", debugstr_wn(str, i));
     pStubMsg->ActualCount = i + 1;
     esize = 2;
@@ -2507,20 +2505,18 @@ void WINAPI NdrNonConformantStringBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
 
   if (*pFormat == RPC_FC_CSTRING)
   {
-    ULONG i;
+    ULONG i = 0;
     const char *str = (const char *)pMemory;
-    for (i = 0; i < maxsize && *str; i++, str++)
-        ;
+    while (i < maxsize && str[i]) i++;
     TRACE("string=%s\n", debugstr_an(str, i));
     pStubMsg->ActualCount = i + 1;
     esize = 1;
   }
   else if (*pFormat == RPC_FC_WSTRING)
   {
-    ULONG i;
+    ULONG i = 0;
     const WCHAR *str = (const WCHAR *)pMemory;
-    for (i = 0; i < maxsize && *str; i++, str++)
-        ;
+    while (i < maxsize && str[i]) i++;
     TRACE("string=%s\n", debugstr_wn(str, i));
     pStubMsg->ActualCount = i + 1;
     esize = 2;




More information about the wine-cvs mailing list