From: Florian Krohm Date: Mon, 29 Dec 2014 20:23:11 +0000 (+0000) Subject: Change a logging function to use SizeT (tracking VEX r3047). X-Git-Tag: svn/VALGRIND_3_11_0~749 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49d07591edf2391f51a44f199002695df0341443;p=thirdparty%2Fvalgrind.git Change a logging function to use SizeT (tracking VEX r3047). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14837 --- 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]); }