From de34792f070ea8f2d64ad2b95ba9fe4b8ca13264 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Tue, 4 Nov 1997 05:33:15 +0000 Subject: [PATCH] Localize it --- usr.bin/hexdump/hexdump.c | 6 ++++-- usr.bin/hexdump/odsyntax.c | 7 +++---- usr.bin/hexdump/parse.c | 13 ++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c index 36d35a38e65..8491c42d0d5 100644 --- a/usr.bin/hexdump/hexdump.c +++ b/usr.bin/hexdump/hexdump.c @@ -42,11 +42,11 @@ static const char copyright[] = static char sccsid[] = "@(#)hexdump.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: hexdump.c,v 1.2 1997/07/10 06:48:16 charnier Exp $"; #endif /* not lint */ #include - +#include #include #include #include @@ -65,6 +65,8 @@ main(argc, argv) register FS *tfs; char *p; + (void)setlocale(LC_CTYPE, ""); + if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od")) newsyntax(argc, &argv); else diff --git a/usr.bin/hexdump/odsyntax.c b/usr.bin/hexdump/odsyntax.c index 5c6d3e118a1..7ad7c37c1b7 100644 --- a/usr.bin/hexdump/odsyntax.c +++ b/usr.bin/hexdump/odsyntax.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)odsyntax.c 8.2 (Berkeley) 5/4/95"; #endif static const char rcsid[] = - "$Id$"; + "$Id: odsyntax.c,v 1.5 1997/07/10 06:48:21 charnier Exp $"; #endif /* not lint */ #include @@ -161,9 +161,8 @@ odoffset(argc, argvp) char ***argvp; { extern off_t skip; - register char *num, *p; + unsigned char *p, *num, *end; int base; - char *end; /* * The offset syntax of od(1) was genuinely bizarre. First, if @@ -215,7 +214,7 @@ odoffset(argc, argvp) base = 10; } - skip = strtol(num, &end, base ? base : 8); + skip = strtol(num, (char **)&end, base ? base : 8); /* if end isn't the same as p, we got a non-octal digit */ if (end != p) { diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index 6fae728d8ca..34a223649e6 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: parse.c,v 1.2 1997/07/10 06:48:24 charnier Exp $"; #endif /* not lint */ #include @@ -55,7 +55,7 @@ void addfile(name) char *name; { - register char *p; + register unsigned char *p; FILE *fp; int ch; char buf[2048 + 1]; @@ -81,11 +81,10 @@ void add(fmt) char *fmt; { - register char *p; + unsigned char *p, *savep; static FS **nextfs; FS *tfs; FU *tfu, **nextfu; - char *savep; /* start new linked list of format units */ tfs = emalloc(sizeof(FS)); @@ -158,7 +157,7 @@ size(fs) { register FU *fu; register int bcnt, cursize; - register char *fmt; + register unsigned char *fmt; int prec; /* figure out the data block size needed for each format unit */ @@ -213,8 +212,8 @@ rewrite(fs) enum { NOTOKAY, USEBCNT, USEPREC } sokay; register PR *pr, **nextpr; register FU *fu; - register char *p1, *p2; - char savech, *fmtp, cs[3]; + unsigned char *p1, *p2, *fmtp; + char savech, cs[3]; int nconv, prec; for (fu = fs->nextfu; fu; fu = fu->nextfu) {