fix bug in hexdump

This commit is contained in:
CismonX 2020-06-08 11:46:26 +08:00
parent 3719a44998
commit 280327e98e
No known key found for this signature in database
GPG Key ID: 315D6652268C5007
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ u6a_hexdump(FILE* restrict output_stream, const char* data, const char* formatte
fprintf_check(output_stream, "%02x ", data[idx]);
}
int blanks = (U6A_HEXDUMP_BYTES_PER_LINE - remaining) / 2 * 5;
fprintf_check(output_stream, " %*s%s\n", blanks, "", formatted + length - remaining);
fprintf_check(output_stream, " %*s%.*s\n", blanks, "", remaining, formatted + length - remaining);
} else {
fprintf_check(output_stream, format, idx, D_INC_DUP_16, formatted + idx);
}