From 3baed68df43a850424c4c2c8a2c89d29e5b8eb5b Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Mon, 11 Sep 2023 02:08:32 -0400 Subject: Oops, you ding dong --- main.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/main.c b/main.c index 3b8c8c0..71910e2 100644 --- a/main.c +++ b/main.c @@ -67,6 +67,10 @@ static inline int zx_putchar(uint8_t c) { uint8_t sequence[4]; size_t len = utf8_encode(sequence, zx_charset[c]); + if (c > 63) { + fprintf(stderr, "What the fuck? Got c %02x\n", c); + } + if (fwrite(sequence, len, 1, stdout) < 1) { goto error_io; } @@ -84,21 +88,15 @@ static ssize_t dump_line(off_t offset, void *buf, size_t len, int tty) { goto error_io; } - for (i=0; i 0 && (i % ZXDUMP_STRIDE_GROUP) == 0) { if (putchar(' ') < 0) { goto error_io; } } - if (i < len) { - if (printf("%02x", ((uint8_t *)buf)[offset+i]) < 0) { - goto error_io; - } - } else { - if (printf(" ") < 0) { - goto error_io; - } + if (printf("%02x", ((uint8_t *)buf)[offset+i]) < 0) { + goto error_io; } } @@ -106,10 +104,10 @@ static ssize_t dump_line(off_t offset, void *buf, size_t len, int tty) { goto error_io; } - for (i=0; i