]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change a logging function to use SizeT (tracking VEX r3047).
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 29 Dec 2014 20:23:11 +0000 (20:23 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 29 Dec 2014 20:23:11 +0000 (20:23 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14837

coregrind/m_translate.c

index afbbe52034d96b551de0d9ef446636a5e0d29ce0..386465733e2abfd1074ce6577f1e91dc103e9fa1 100644 (file)
@@ -734,11 +734,12 @@ void failure_exit ( void )
 }
 
 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]);
 }