diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-31 05:36:37 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-31 05:36:37 +0000 |
commit | ffc47002c5a263357f88148528c3aa69712f5d32 (patch) | |
tree | 06e893c19c0eb3e9d06cdb60f1a8e9bd111a1898 /lib/libc | |
parent | c8efa347bd9e4717cd854ad52a147dd8550d0a45 (diff) |
(char)to{upper,lower}()
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/fnmatch.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/readpassphrase.c | 6 | ||||
-rw-r--r-- | lib/libc/net/nsap_addr.c | 8 | ||||
-rw-r--r-- | lib/libc/regex/regcomp.c | 6 | ||||
-rw-r--r-- | lib/libc/string/strcasestr.c | 4 |
5 files changed, 16 insertions, 16 deletions
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index 551ba56419e..5a282f1e596 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fnmatch.c,v 1.12 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: fnmatch.c,v 1.13 2006/03/31 05:34:14 deraadt Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -167,7 +167,7 @@ rangematch(const char *pattern, char test, int flags, char **newp) ++pattern; if (flags & FNM_CASEFOLD) - test = tolower((unsigned char)test); + test = (char)tolower((unsigned char)test); /* * A right bracket shall lose its special meaning and represent @@ -184,7 +184,7 @@ rangematch(const char *pattern, char test, int flags, char **newp) if (c == '/' && (flags & FNM_PATHNAME)) return (RANGE_NOMATCH); if ((flags & FNM_CASEFOLD)) - c = tolower((unsigned char)c); + c = (char)tolower((unsigned char)c); if (*pattern == '-' && (c2 = *(pattern+1)) != EOS && c2 != ']') { pattern += 2; @@ -193,7 +193,7 @@ rangematch(const char *pattern, char test, int flags, char **newp) if (c2 == EOS) return (RANGE_ERROR); if (flags & FNM_CASEFOLD) - c2 = tolower((unsigned char)c2); + c2 = (char)tolower((unsigned char)c2); if (c <= test && test <= c2) ok = 1; } else if (c == test) diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c index 8e6dde432c4..860494054ce 100644 --- a/lib/libc/gen/readpassphrase.c +++ b/lib/libc/gen/readpassphrase.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readpassphrase.c,v 1.18 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.19 2006/03/31 05:33:59 deraadt Exp $ */ /* * Copyright (c) 2000-2002 Todd C. Miller <Todd.Miller@courtesan.com> @@ -109,9 +109,9 @@ restart: ch &= 0x7f; if (isalpha(ch)) { if ((flags & RPP_FORCELOWER)) - ch = tolower(ch); + ch = (char)tolower(ch); if ((flags & RPP_FORCEUPPER)) - ch = toupper(ch); + ch = (char)toupper(ch); } *p++ = ch; } diff --git a/lib/libc/net/nsap_addr.c b/lib/libc/net/nsap_addr.c index 50e3bdda95d..8cfe86f4752 100644 --- a/lib/libc/net/nsap_addr.c +++ b/lib/libc/net/nsap_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsap_addr.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */ +/* $OpenBSD: nsap_addr.c,v 1.7 2006/03/31 05:35:44 deraadt Exp $ */ /* * Copyright (c) 1996 by Internet Software Consortium. @@ -25,7 +25,7 @@ #include <ctype.h> #include <resolv.h> -static char +static u_char xtob(int c) { return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); @@ -43,11 +43,11 @@ inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) if (!isascii(c)) return (0); if (islower(c)) - c = toupper(c); + c = (u_char)toupper(c); if (isxdigit(c)) { nib = xtob(c); if ((c = *ascii++)) { - c = toupper(c); + c = (u_char)toupper(c); if (isxdigit(c)) { *binary++ = (nib << 4) | xtob(c); len++; diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index ad65f3622b8..402c64056f3 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regcomp.c,v 1.15 2005/08/05 13:03:00 espie Exp $ */ +/* $OpenBSD: regcomp.c,v 1.16 2006/03/31 05:36:36 deraadt Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 @@ -856,9 +856,9 @@ othercase(int ch) ch = (uch)ch; assert(isalpha(ch)); if (isupper(ch)) - return(tolower(ch)); + return ((uch)tolower(ch)); else if (islower(ch)) - return(toupper(ch)); + return ((uch)toupper(ch)); else /* peculiar, but could happen */ return(ch); } diff --git a/lib/libc/string/strcasestr.c b/lib/libc/string/strcasestr.c index 07c8c2e8fb3..aa74c0176dc 100644 --- a/lib/libc/string/strcasestr.c +++ b/lib/libc/string/strcasestr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strcasestr.c,v 1.2 2005/08/08 08:05:37 espie Exp $ */ +/* $OpenBSD: strcasestr.c,v 1.3 2006/03/31 05:34:55 deraadt Exp $ */ /* $NetBSD: strcasestr.c,v 1.2 2005/02/09 21:35:47 kleink Exp $ */ /*- @@ -46,7 +46,7 @@ strcasestr(const char *s, const char *find) size_t len; if ((c = *find++) != 0) { - c = tolower((unsigned char)c); + c = (char)tolower((unsigned char)c); len = strlen(find); do { do { |