From fae9d6681de41e40a31d5da4047e762fa0a3c652 Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Wed, 13 Oct 2021 17:40:48 -0700 Subject: [PATCH] Update utility.cpp - address review comment --- common/utility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utility.cpp b/common/utility.cpp index f1e623e..a054879 100755 --- a/common/utility.cpp +++ b/common/utility.cpp @@ -33,7 +33,7 @@ UString visibleAsciiOrHex(UINT8* bytes, UINT32 length) for (UINT32 i = 0; i < length; i++) { hexString += usprintf("%02X", bytes[i]); - if (bytes[i] == '\x00') { // Check for the rest of the buffer being zeroes, and make the whole previous string visible, if so + if (ascii && i > 0 && bytes[i] == '\x00') { // Check for the rest of the buffer being zeroes, and make the whole previous string visible, if so for (UINT32 j = i + 1; j < length; j++) { if (bytes[j] != '\x00') { ascii = false;