aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-12-13 17:33:21 +0000
committerMax Horn2003-12-13 17:33:21 +0000
commit5ff7c1d1532663eb8a00bbf60c39ba560a50a67f (patch)
treea7ffba8f4a87d97d691629fea08b3d4d41002275
parentfe05c6fb4dee1b7b4db1f91b8750a7c76cafa022 (diff)
downloadscummvm-rg350-5ff7c1d1532663eb8a00bbf60c39ba560a50a67f.tar.gz
scummvm-rg350-5ff7c1d1532663eb8a00bbf60c39ba560a50a67f.tar.bz2
scummvm-rg350-5ff7c1d1532663eb8a00bbf60c39ba560a50a67f.zip
small fix for hexdump()
svn-id: r11617
-rw-r--r--common/util.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/util.cpp b/common/util.cpp
index ce63a15413..f270025816 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -56,13 +56,14 @@ void hexdump(const byte * data, int len, int bytesPerLine) {
return;
printf("%06x: ", offset);
- for (i = 0; i < len; i++) {
- printf("%02x ", data[i]);
+ for (i = 0; i < bytesPerLine; i++) {
+ if (i < len)
+ printf("%02x ", data[i]);
+ else
+ printf(" ");
if (i % 4 == 3)
printf(" ");
}
- for (; i < bytesPerLine; i++)
- printf(" ");
printf(" |");
for (i = 0; i < len; i++) {
c = data[i];