summaryrefslogtreecommitdiff
path: root/decoder/source/trc_printable_elem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/source/trc_printable_elem.cpp')
-rw-r--r--decoder/source/trc_printable_elem.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/decoder/source/trc_printable_elem.cpp b/decoder/source/trc_printable_elem.cpp
index 2fd49d973579..88c7bb226f41 100644
--- a/decoder/source/trc_printable_elem.cpp
+++ b/decoder/source/trc_printable_elem.cpp
@@ -63,12 +63,15 @@ void trcPrintableElem::getValStr(std::string &valStr, const int valTotalBitSize,
int validChars = valValidBits / 4;
if((valValidBits % 4) > 0) validChars++;
- int QM = numHexChars - validChars;
- while(QM)
- {
- QM--;
- valStr += "?";
- }
+ if (validChars < numHexChars)
+ {
+ int QM = numHexChars - validChars;
+ while (QM)
+ {
+ QM--;
+ valStr += "?";
+ }
+ }
if(valValidBits > 32)
{
sprintf(szFormatBuffer,"%%0%dllX",validChars); // create the format