gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31580 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r31580 - gnunet/src/gns
Date: Thu, 19 Dec 2013 19:39:05 +0100

Author: LRN
Date: 2013-12-19 19:39:04 +0100 (Thu, 19 Dec 2013)
New Revision: 31580

Modified:
   gnunet/src/gns/gnunet-gns-helper-service-w32.c
Log:
Fix 0-terminator check, logging

Modified: gnunet/src/gns/gnunet-gns-helper-service-w32.c
===================================================================
--- gnunet/src/gns/gnunet-gns-helper-service-w32.c      2013-12-19 18:39:02 UTC 
(rev 31579)
+++ gnunet/src/gns/gnunet-gns-helper-service-w32.c      2013-12-19 18:39:04 UTC 
(rev 31580)
@@ -694,10 +694,12 @@
               sc.Data4[3], sc.Data4[4], sc.Data4[5], sc.Data4[6], sc.Data4[7]);
 
   hostname = (const wchar_t *) &msg[1];
-  if (hostname[size - 1] != L'\0')
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "name of %u bytes (last word is 0x%0X): 
%*S\n",
+        size, hostname[size / 2 - 2], size / 2, hostname);
+  if (hostname[size / 2 - 1] != L'\0')
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "name of length %u, not 0-terminated: 
%*S\n",
-        size, size, hostname);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "name of length %u, not 0-terminated 
(%d-th word is 0x%0X): %*S\n",
+        size, size / 2 - 1, hostname[size / 2 - 1], size, hostname);
     GNUNET_break (0);
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]