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); }