|
From: <sv...@va...> - 2014-12-29 20:23:29
|
Author: florian
Date: Mon Dec 29 20:23:11 2014
New Revision: 14837
Log:
Change a logging function to use SizeT (tracking VEX r3047).
Modified:
trunk/coregrind/m_translate.c
Modified: trunk/coregrind/m_translate.c
==============================================================================
--- trunk/coregrind/m_translate.c (original)
+++ trunk/coregrind/m_translate.c Mon Dec 29 20:23:11 2014
@@ -734,11 +734,12 @@
}
static
-void log_bytes ( HChar* bytes, Int nbytes )
+void log_bytes ( const HChar* bytes, SizeT nbytes )
{
- Int i;
- for (i = 0; i < nbytes-3; i += 4)
- VG_(printf)("%c%c%c%c", bytes[i], bytes[i+1], bytes[i+2], bytes[i+3]);
+ SizeT i = 0;
+ if (nbytes >= 4)
+ for (; i < nbytes-3; i += 4)
+ VG_(printf)("%c%c%c%c", bytes[i], bytes[i+1], bytes[i+2], bytes[i+3]);
for (; i < nbytes; i++)
VG_(printf)("%c", bytes[i]);
}
|