aboutsummaryrefslogtreecommitdiff
path: root/toys/other
diff options
context:
space:
mode:
Diffstat (limited to 'toys/other')
-rw-r--r--toys/other/ascii.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/toys/other/ascii.c b/toys/other/ascii.c
index 4d33ae61..6689191c 100644
--- a/toys/other/ascii.c
+++ b/toys/other/ascii.c
@@ -26,13 +26,14 @@ void ascii_main(void)
for (x = 0; x<8; x++) printf("Dec Hex%*c", 2+2*(x<2)+(x>4), ' ');
xputc('\n');
- for (y=0; y<15; y++) {
+ for (y=0; y<=15; y++) {
for (x=0; x<8; x++) {
int i = x*16+y;
+ if (i>95 && i<100) putchar(' ');
printf("% 3d %02X ", i, i);
- if (i<32) printf("%.3s ", low+3*i);
- else printf("%*c ", 2*(i>95 && i<100), i);
+ if (i<32 || i==127) printf("%.3s ", (i==127) ? "DEL" : low+3*i);
+ else printf("%c ", i);
}
xputc('\n');
}