diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-09-15 22:12:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-09-15 22:12:20 +0000 |
commit | b8b24216a0b3f2ce1dcd07b6c6894f835e0e8767 (patch) | |
tree | 992cc5405177cea7aa58836db78fae37f6d1b5e2 /usr.bin | |
parent | 9b46ba18f9ee96fa26df28c1b79425e1f55d71be (diff) |
signed and unsigned char wiggles
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tr/str.c | 20 | ||||
-rw-r--r-- | usr.bin/tr/tr.c | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/usr.bin/tr/str.c b/usr.bin/tr/str.c index 95312fd5769..4f9393815ce 100644 --- a/usr.bin/tr/str.c +++ b/usr.bin/tr/str.c @@ -1,4 +1,4 @@ -/* $OpenBSD: str.c,v 1.8 2003/06/03 02:56:20 millert Exp $ */ +/* $OpenBSD: str.c,v 1.9 2004/09/15 22:12:19 deraadt Exp $ */ /* $NetBSD: str.c,v 1.7 1995/08/31 22:13:47 jtc Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95"; #endif -static char rcsid[] = "$OpenBSD: str.c,v 1.8 2003/06/03 02:56:20 millert Exp $"; +static char rcsid[] = "$OpenBSD: str.c,v 1.9 2004/09/15 22:12:19 deraadt Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -124,21 +124,21 @@ bracket(s) switch (s->str[1]) { case ':': /* "[:class:]" */ - if ((p = strstr(s->str + 2, ":]")) == NULL) + if ((p = strstr((char *)s->str + 2, ":]")) == NULL) return (0); *p = '\0'; s->str += 2; genclass(s); - s->str = p + 2; + s->str = (unsigned char *)p + 2; return (1); case '=': /* "[=equiv=]" */ - if ((p = strstr(s->str + 2, "=]")) == NULL) + if ((p = strstr((char *)s->str + 2, "=]")) == NULL) return (0); s->str += 2; genequiv(s); return (1); default: /* "[\###*n]" or "[#*n]" */ - if ((p = strpbrk(s->str + 2, "*]")) == NULL) + if ((p = strpbrk((char *)s->str + 2, "*]")) == NULL) return (0); if (p[0] != '*' || strchr(p, ']') == NULL) return (0); @@ -178,7 +178,7 @@ genclass(s) CLASS *cp, tmp; int *p; - tmp.name = s->str; + tmp.name = (char *)s->str; if ((cp = (CLASS *)bsearch(&tmp, classes, sizeof(classes) / sizeof(CLASS), sizeof(CLASS), c_class)) == NULL) errx(1, "unknown class %s", s->str); @@ -231,7 +231,7 @@ genrange(s) STR *s; { int stopval; - char *savestart; + unsigned char *savestart; savestart = s->str; stopval = *++s->str == '\\' ? backslash(s) : *s->str++; @@ -271,9 +271,9 @@ genseq(s) break; default: if (isdigit(*s->str)) { - s->cnt = strtol(s->str, &ep, 0); + s->cnt = strtol((char *)s->str, &ep, 0); if (*ep == ']') { - s->str = ep + 1; + s->str = (unsigned char *)ep + 1; break; } } diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index bda2adb8252..501c208b14b 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tr.c,v 1.12 2004/05/09 03:20:20 deraadt Exp $ */ +/* $OpenBSD: tr.c,v 1.13 2004/09/15 22:12:19 deraadt Exp $ */ /* $NetBSD: tr.c,v 1.5 1995/08/31 22:13:48 jtc Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95"; #endif -static char rcsid[] = "$OpenBSD: tr.c,v 1.12 2004/05/09 03:20:20 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: tr.c,v 1.13 2004/09/15 22:12:19 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -192,8 +192,8 @@ main(int argc, char *argv[]) if (!isstring2) usage(); - s1.str = argv[0]; - s2.str = argv[1]; + s1.str = (unsigned char *)argv[0]; + s2.str = (unsigned char *)argv[1]; if (cflag) for (cnt = NCHARS, p = string1; cnt--;) @@ -239,7 +239,7 @@ setup(int *string, char *arg, STR *str, int cflag) { int cnt, *p; - str->str = arg; + str->str = (unsigned char *)arg; bzero(string, NCHARS * sizeof(int)); while (next(str)) string[str->lastch] = 1; |