sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 32ec11e3b2407ad5ddf5e9627aea1ccad97bf79a
parent fd1bc5f6cbb8ed3c2ba351229d32d292a2ab2a03
Author: FRIGN <dev@frign.de>
Date:   Tue Sep 29 23:40:20 +0200

Properly handle namedict in od(1)

I added the [127]-index but forgot that this increases the length,
breaking a later check.

Diffstat:
od.c | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/od.c b/od.c @@ -36,7 +36,6 @@ printchar(FILE *f, unsigned char c) "so", "si", "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc", "fs", "gs", "rs", "us", "sp", - [127] = "del" }; const char *escdict[] = { ['\0'] = "\\0", ['\a'] = "\\a", @@ -56,7 +55,7 @@ printchar(FILE *f, unsigned char c) case 'a': c &= ~128; /* clear high bit as required by standard */ if (c < LEN(namedict) || c == 127) { - fprintf(f, "%3s ", namedict[c]); + fprintf(f, "%3s ", (c == 127) ? "del" : namedict[c]); return; } break;