From 8684cbb5cc2c461e3795fba19ad7386db37cf499 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 18 Nov 2009 11:34:43 +0100 Subject: libbb: robustify isXXXX(). +39 bytes Signed-off-by: Denys Vlasenko --- coreutils/sort.c | 2 +- coreutils/tr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'coreutils') diff --git a/coreutils/sort.c b/coreutils/sort.c index fad6d12..e2e7983 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -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'; } diff --git a/coreutils/tr.c b/coreutils/tr.c index d89b80b..6d4cb4a 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -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; -- cgit v1.1