From ffc4374869b9ac10539a3c18e13b29d1b0c64484 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:53 +0100 Subject: Imported from util-linux-2.11o tarball. --- text-utils/conv.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'text-utils/conv.c') diff --git a/text-utils/conv.c b/text-utils/conv.c index 2a256fa23..8e0efa16d 100644 --- a/text-utils/conv.c +++ b/text-utils/conv.c @@ -36,10 +36,11 @@ #include #include "hexdump.h" -void conv_c(PR *pr, u_char *p) +void +conv_c(PR *pr, u_char *p) { - extern int deprecated; - char buf[10], *str; + char buf[10]; + char const *str; switch(*p) { case '\0': @@ -78,16 +79,17 @@ void conv_c(PR *pr, u_char *p) *pr->cchar = 'c'; (void)printf(pr->fmt, *p); } else { - (void)sprintf(str = buf, "%03o", (int)*p); + (void)sprintf(buf, "%03o", (int)*p); + str = buf; strpr: *pr->cchar = 's'; (void)printf(pr->fmt, str); } } -void conv_u(PR *pr, u_char *p) +void +conv_u(PR *pr, u_char *p) { - extern int deprecated; - static char *list[] = { + static const char *list[] = { "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "lf", "vt", "ff", "cr", "so", "si", "dle", "dcl", "dc2", "dc3", "dc4", "nak", "syn", "etb", @@ -104,7 +106,7 @@ void conv_u(PR *pr, u_char *p) } else if (*p == 0x7f) { *pr->cchar = 's'; (void)printf(pr->fmt, "del"); - } else if (deprecated && *p == 0x20) { /* od replace space with sp */ + } else if (deprecated && *p == 0x20) { /* od replaced space with sp */ *pr->cchar = 's'; (void)printf(pr->fmt, " sp"); } else if (isprint(*p)) { -- cgit v1.2.3-55-g7522