From 49d07591edf2391f51a44f199002695df0341443 Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Mon, 29 Dec 2014 20:23:11 +0000 Subject: [PATCH] Change a logging function to use SizeT (tracking VEX r3047). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14837 --- coregrind/m_translate.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/coregrind/m_translate.c b/coregrind/m_translate.c index afbbe52034..386465733e 100644 --- a/coregrind/m_translate.c +++ b/coregrind/m_translate.c @@ -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]); } -- 2.47.3