From 4c48fdaf535798832cfb2d19cc3f44f2577e170c Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Tue, 28 Mar 2000 11:36:31 +0000 Subject: [PATCH] Describe valid argument domain for 8-bit wide locales to prevent common error calling ctype functions with signed char as an argument. --- lib/libc/locale/isalnum.3 | 2 ++ lib/libc/locale/isalpha.3 | 2 ++ lib/libc/locale/isascii.3 | 2 ++ lib/libc/locale/isblank.3 | 2 ++ lib/libc/locale/iscntrl.3 | 2 ++ lib/libc/locale/isdigit.3 | 2 ++ lib/libc/locale/isgraph.3 | 2 ++ lib/libc/locale/islower.3 | 2 ++ lib/libc/locale/isprint.3 | 2 ++ lib/libc/locale/ispunct.3 | 2 ++ lib/libc/locale/isspace.3 | 2 ++ lib/libc/locale/isupper.3 | 2 ++ lib/libc/locale/isxdigit.3 | 2 ++ lib/libc/locale/tolower.3 | 2 ++ lib/libc/locale/toupper.3 | 2 ++ 15 files changed, 30 insertions(+) diff --git a/lib/libc/locale/isalnum.3 b/lib/libc/locale/isalnum.3 index 60ad8c4e4341..b548c58ecd13 100644 --- a/lib/libc/locale/isalnum.3 +++ b/lib/libc/locale/isalnum.3 @@ -54,6 +54,8 @@ function tests for any character for which or .Xr isdigit 3 is true. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/isalpha.3 b/lib/libc/locale/isalpha.3 index 5dd0a04cf2c5..4bfed345b1ee 100644 --- a/lib/libc/locale/isalpha.3 +++ b/lib/libc/locale/isalpha.3 @@ -54,6 +54,8 @@ function tests for any character for which or .Xr islower 3 is true. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/isascii.3 b/lib/libc/locale/isascii.3 index 9700218f1b23..bdb183bef7a5 100644 --- a/lib/libc/locale/isascii.3 +++ b/lib/libc/locale/isascii.3 @@ -49,6 +49,8 @@ function tests for an .Tn ASCII character, which is any character with a value less than or equal to octal 0177. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. .Sh SEE ALSO .Xr ctype 3 , .Xr ascii 7 diff --git a/lib/libc/locale/isblank.3 b/lib/libc/locale/isblank.3 index c0ec34d0dbd2..545cbe6030e5 100644 --- a/lib/libc/locale/isblank.3 +++ b/lib/libc/locale/isblank.3 @@ -46,6 +46,8 @@ The .Fn isblank function tests for a space or tab character. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. .Sh RETURN VALUES The .Fn isblank diff --git a/lib/libc/locale/iscntrl.3 b/lib/libc/locale/iscntrl.3 index ea010014310f..4289e4c4237a 100644 --- a/lib/libc/locale/iscntrl.3 +++ b/lib/libc/locale/iscntrl.3 @@ -50,6 +50,8 @@ The .Fn iscntrl function tests for any control character. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/isdigit.3 b/lib/libc/locale/isdigit.3 index fa3a736eeff6..24c3e786476e 100644 --- a/lib/libc/locale/isdigit.3 +++ b/lib/libc/locale/isdigit.3 @@ -50,6 +50,8 @@ The .Fn isdigit function tests for any decimal-digit character. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/isgraph.3 b/lib/libc/locale/isgraph.3 index 347af3a2848c..53273980c464 100644 --- a/lib/libc/locale/isgraph.3 +++ b/lib/libc/locale/isgraph.3 @@ -50,6 +50,8 @@ The .Fn isgraph function tests for any printing character except space. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/islower.3 b/lib/libc/locale/islower.3 index 5d767c2d1b1a..37e3022d5bd3 100644 --- a/lib/libc/locale/islower.3 +++ b/lib/libc/locale/islower.3 @@ -50,6 +50,8 @@ The .Fn islower function tests for any lower-case letters. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/isprint.3 b/lib/libc/locale/isprint.3 index 6bf1f554aa78..6af22578746a 100644 --- a/lib/libc/locale/isprint.3 +++ b/lib/libc/locale/isprint.3 @@ -50,6 +50,8 @@ The .Fn isprint function tests for any printing character including space (' '). +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/ispunct.3 b/lib/libc/locale/ispunct.3 index f80d41c230a9..5d8bf72626b4 100644 --- a/lib/libc/locale/ispunct.3 +++ b/lib/libc/locale/ispunct.3 @@ -53,6 +53,8 @@ function tests for any printing character except for space (' ') or a character for which .Xr isalnum 3 is true. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/isspace.3 b/lib/libc/locale/isspace.3 index e8fa978c60b4..d1e8795c0b8e 100644 --- a/lib/libc/locale/isspace.3 +++ b/lib/libc/locale/isspace.3 @@ -50,6 +50,8 @@ The .Fn isspace function tests for the standard white-space characters. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/isupper.3 b/lib/libc/locale/isupper.3 index 1ec34d713ae4..b0603455c459 100644 --- a/lib/libc/locale/isupper.3 +++ b/lib/libc/locale/isupper.3 @@ -50,6 +50,8 @@ The .Fn isupper function tests for any upper-case letter. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/isxdigit.3 b/lib/libc/locale/isxdigit.3 index f2e2ec8a316c..fc0dae9b15a5 100644 --- a/lib/libc/locale/isxdigit.3 +++ b/lib/libc/locale/isxdigit.3 @@ -50,6 +50,8 @@ The .Fn isxdigit function tests for any hexadecimal-digit character. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Pp diff --git a/lib/libc/locale/tolower.3 b/lib/libc/locale/tolower.3 index 1bd82c294942..dfb7c2510df4 100644 --- a/lib/libc/locale/tolower.3 +++ b/lib/libc/locale/tolower.3 @@ -51,6 +51,8 @@ The .Fn tolower function converts an upper-case letter to the corresponding lower-case letter. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. .Sh RETURN VALUES If the argument is an upper-case letter, the .Fn tolower diff --git a/lib/libc/locale/toupper.3 b/lib/libc/locale/toupper.3 index 33742da48de3..28bc027f3587 100644 --- a/lib/libc/locale/toupper.3 +++ b/lib/libc/locale/toupper.3 @@ -51,6 +51,8 @@ The .Fn toupper function converts a lower-case letter to the corresponding upper-case letter. +For 8-bit wide locales the value of the argument is +representable as an unsigned char or the value of EOF. .SH RETURN VALUES If the argument is a lower-case letter, the .Fn toupper