diff --git a/src/modal.c b/src/modal.c index ebc959a..305041e 100644 --- a/src/modal.c +++ b/src/modal.c @@ -84,11 +84,13 @@ device_write(char *s) static void device_read(void) { - char c; + char c, *origin = dst_; while(fread(&c, 1, 1, stdin) && c >= ' ') *dst_++ = c; if(feof(stdin)) *dst_++ = 'E', *dst_++ = 'O', *dst_++ = 'F'; + if(dst_ - origin == 0) + dst_--; } static void