summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXANTRONIX Development2023-09-10 23:42:26 -0400
committerXANTRONIX Development2023-09-10 23:42:26 -0400
commit011f5e89b7dee4b306504e243052bfaf933b2685 (patch)
treedda58669af88e0b74315cb1968c73ec3de42fc1a
parentbd5268cd628d75dcf4214e7ee40f23904964baef (diff)
downloadzxdump-011f5e89b7dee4b306504e243052bfaf933b2685.tar.gz
zxdump-011f5e89b7dee4b306504e243052bfaf933b2685.tar.bz2
zxdump-011f5e89b7dee4b306504e243052bfaf933b2685.zip
OH NO I FLATTENED THE CODE A BIT, WANNA FIGHT ME?
-rw-r--r--main.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/main.c b/main.c
index 72a7d09..3b8c8c0 100644
--- a/main.c
+++ b/main.c
@@ -113,23 +113,21 @@ static ssize_t dump_line(off_t offset, void *buf, size_t len, int tty) {
if (zx_putchar(c) < 0) {
goto error_io;
}
+ } else if (c >= 0xa0 && c <= 0xbf) {
+ if (tty && printf("\033[7m") < 0) {
+ goto error_io;
+ }
+
+ if (zx_putchar(c - 0xa0) < 0) {
+ goto error_io;
+ }
+
+ if (tty && printf("\033[27m") < 0) {
+ goto error_io;
+ }
} else {
- if (c >= 0xa0 && c <= 0xbf) {
- if (tty && printf("\033[7m") < 0) {
- goto error_io;
- }
-
- if (zx_putchar(c - 0xa0) < 0) {
- goto error_io;
- }
-
- if (tty && printf("\033[27m") < 0) {
- goto error_io;
- }
- } else {
- if (putchar('.') < 0) {
- goto error_io;
- }
+ if (putchar('.') < 0) {
+ goto error_io;
}
}
}