From 97a686913cb3f115ac34988e01e434969fea7143 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 13 May 2024 15:31:14 -0700 Subject: [PATCH] Raw byte export --- examples/binary.modal | 4 ++-- src/modal.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/binary.modal b/examples/binary.modal index 106f046..d43dce0 100644 --- a/examples/binary.modal +++ b/examples/binary.modal @@ -1,7 +1,7 @@ ?(?: ?:) \#48 -?(?: ?:) \101 +?(?: ?:) \#65 +?(?: ?:) \#6c ?(?: ?:) \#6c -?(?: ?:) \108 ?(?: ?:) \#6f ?(?: ?:) \#ce diff --git a/src/modal.c b/src/modal.c index 08d4bc4..1d41808 100644 --- a/src/modal.c +++ b/src/modal.c @@ -83,15 +83,14 @@ device_write(char *s) char *cap = walk(s); if(*s == '(') s++, --cap; while(s < cap) { - char c = *s++; + char c = *s++, hb, lb; if(c == '\\') { switch(*s++) { case 't': putc(0x09, stdout); break; case 'n': putc(0x0a, stdout); break; case 's': putc(0x20, stdout); break; - default: putc(sint(--s), stdout), s = walk(s); + case '#': hb = *s++, lb = *s++, putc((chex(hb) << 4) | chex(lb), stdout); break; } - } else putc(c, stdout); }