summaryrefslogtreecommitdiff
path: root/lib/libc/gen/toupper_.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2005-08-08 05:53:02 +0000
committerMarc Espie <espie@cvs.openbsd.org>2005-08-08 05:53:02 +0000
commitb83058fd179b6de492fa3ed6292d2821ca253806 (patch)
tree2baae503ebb022ad1d8ff55383cedcf18b319815 /lib/libc/gen/toupper_.c
parent9912e93b5b9dbc80863c5b26ff459f0587f40cbe (diff)
activate LC_CTYPE for 8 bits locale.
Make sure tolower/toupper use the whole 8 bits. okay deraadt@ thanks to everyone who tested
Diffstat (limited to 'lib/libc/gen/toupper_.c')
-rw-r--r--lib/libc/gen/toupper_.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/gen/toupper_.c b/lib/libc/gen/toupper_.c
index 65b6cfab977..fdb87bc3a29 100644
--- a/lib/libc/gen/toupper_.c
+++ b/lib/libc/gen/toupper_.c
@@ -4,13 +4,15 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: toupper_.c,v 1.7 2004/05/18 02:05:52 jfb Exp $";
+static char rcsid[] = "$OpenBSD: toupper_.c,v 1.8 2005/08/08 05:53:00 espie Exp $";
#endif /* LIBC_SCCS and not lint */
#define _ANSI_LIBRARY
#include <ctype.h>
#include <stdio.h>
+#include "ctype_private.h"
+
const short _C_toupper_[1 + 256] = {
EOF,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
@@ -53,7 +55,7 @@ const short *_toupper_tab_ = _C_toupper_;
int
toupper(int c)
{
- if ((unsigned int)c > 0177)
+ if ((unsigned int)c > 255)
return(c);
return((_toupper_tab_ + 1)[c]);
}