libbb: robustify isXXXX(). +39 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2009-11-18 11:34:43 +01:00
parent 5b0a7f1a6e
commit 8684cbb5cc
9 changed files with 28 additions and 25 deletions

View File

@@ -128,7 +128,7 @@ static char *get_key(char *str, struct sort_key *key, int flags)
/* Handle -i */
if (flags & FLAG_i) {
for (start = end = 0; str[end]; end++)
if (isprint(str[end]))
if (isprint_asciionly(str[end]))
str[start++] = str[end];
str[start] = '\0';
}

View File

@@ -153,7 +153,7 @@ static unsigned expand(const char *arg, char **buffer_p)
}
if (j == CLASS_punct || j == CLASS_cntrl) {
for (i = '\0'; i < ASCII; i++) {
if ((j == CLASS_punct && isprint(i) && !isalnum(i) && !isspace(i))
if ((j == CLASS_punct && isprint_asciionly(i) && !isalnum(i) && !isspace(i))
|| (j == CLASS_cntrl && iscntrl(i))
) {
buffer[pos++] = i;