aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mex.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/mex.c b/src/mex.c
index a4208c0..3b69268 100644
--- a/src/mex.c
+++ b/src/mex.c
@@ -13,17 +13,11 @@ dump_line(const char *line, size_t len)
for (size_t i = 0; i < LINE_LEN; ++i) {
/* Add padding if needed */
- if (i >= (len*BYTE_COUNT)+1) {
- printf(" ");
- continue;
- }
-
- if (i >= len) {
- /* Don't print any more bytes */
- continue;
+ if (i < len) {
+ printf("%02X", line[i] & 0xFF);
+ } else {
+ printf(" ");
}
-
- printf("%02X", line[i] & 0xFF);
if (((i + 1) % BYTE_COUNT) == 0) {
printf(" ");
}