summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-04-30 05:49:21 +0000
committerderaadt <deraadt@openbsd.org>1998-04-30 05:49:21 +0000
commit5e524d75584b431f7449df2ef8e9583b9ca302a0 (patch)
tree2def8ec8ee735f84fcf3030d07d8fb7458fa32f9
parentOnly use scsi geometry to fake up a label if we were able to get (diff)
downloadwireguard-openbsd-5e524d75584b431f7449df2ef8e9583b9ca302a0.tar.xz
wireguard-openbsd-5e524d75584b431f7449df2ef8e9583b9ca302a0.zip
make ctype macros on char 0x82 and such work
-rw-r--r--include/ctype.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/ctype.h b/include/ctype.h
index 8162bb7f537..942bfc8660a 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctype.h,v 1.2 1997/09/21 10:45:28 niklas Exp $ */
+/* $OpenBSD: ctype.h,v 1.3 1998/04/30 05:49:21 deraadt Exp $ */
/* $NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $ */
/*
@@ -82,25 +82,25 @@ extern int _toupper __P ((int));
#endif
__END_DECLS
-#define isdigit(c) ((_ctype_ + 1)[c] & _N)
-#define islower(c) ((_ctype_ + 1)[c] & _L)
-#define isspace(c) ((_ctype_ + 1)[c] & _S)
-#define ispunct(c) ((_ctype_ + 1)[c] & _P)
-#define isupper(c) ((_ctype_ + 1)[c] & _U)
-#define isalpha(c) ((_ctype_ + 1)[c] & (_U|_L))
-#define isxdigit(c) ((_ctype_ + 1)[c] & (_N|_X))
-#define isalnum(c) ((_ctype_ + 1)[c] & (_U|_L|_N))
-#define isprint(c) ((_ctype_ + 1)[c] & (_P|_U|_L|_N|_B))
-#define isgraph(c) ((_ctype_ + 1)[c] & (_P|_U|_L|_N))
-#define iscntrl(c) ((_ctype_ + 1)[c] & _C)
-#define tolower(c) ((_tolower_tab_ + 1)[c])
-#define toupper(c) ((_toupper_tab_ + 1)[c])
+#define isdigit(c) ((_ctype_ + 1)[(unsigned char)(c)] & _N)
+#define islower(c) ((_ctype_ + 1)[(unsigned char)(c)] & _L)
+#define isspace(c) ((_ctype_ + 1)[(unsigned char)(c)] & _S)
+#define ispunct(c) ((_ctype_ + 1)[(unsigned char)(c)] & _P)
+#define isupper(c) ((_ctype_ + 1)[(unsigned char)(c)] & _U)
+#define isalpha(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_U|_L))
+#define isxdigit(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_N|_X))
+#define isalnum(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_U|_L|_N))
+#define isprint(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_P|_U|_L|_N|_B))
+#define isgraph(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_P|_U|_L|_N))
+#define iscntrl(c) ((_ctype_ + 1)[(unsigned char)(c)] & _C)
+#define tolower(c) ((_tolower_tab_ + 1)[(unsigned char)(c)])
+#define toupper(c) ((_toupper_tab_ + 1)[(unsigned char)(c)])
#if !defined(_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
#if notyet
-#define isblank(c) ((_ctype_ + 1)[c] & _B)
+#define isblank(c) ((_ctype_ + 1)[(unsigned char)(c)] & _B)
#endif
-#define isascii(c) ((unsigned)(c) <= 0177)
+#define isascii(c) ((unsigned char)(c) <= 0177)
#define toascii(c) ((c) & 0177)
#define _tolower(c) ((c) - 'A' + 'a')
#define _toupper(c) ((c) - 'a' + 'A')