diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-18 11:34:43 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-18 11:34:43 +0100 |
commit | 8684cbb5cc2c461e3795fba19ad7386db37cf499 (patch) | |
tree | 027d4aa55cfa710769c86c2aca838fbba3e3dbe9 /coreutils | |
parent | 5b0a7f1a6e66af3f1ff4159d4eb96c30517782b8 (diff) | |
download | busybox-w32-8684cbb5cc2c461e3795fba19ad7386db37cf499.tar.gz busybox-w32-8684cbb5cc2c461e3795fba19ad7386db37cf499.tar.bz2 busybox-w32-8684cbb5cc2c461e3795fba19ad7386db37cf499.zip |
libbb: robustify isXXXX(). +39 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/sort.c | 2 | ||||
-rw-r--r-- | coreutils/tr.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c index fad6d1244..e2e7983a1 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) | |||
128 | /* Handle -i */ | 128 | /* Handle -i */ |
129 | if (flags & FLAG_i) { | 129 | if (flags & FLAG_i) { |
130 | for (start = end = 0; str[end]; end++) | 130 | for (start = end = 0; str[end]; end++) |
131 | if (isprint(str[end])) | 131 | if (isprint_asciionly(str[end])) |
132 | str[start++] = str[end]; | 132 | str[start++] = str[end]; |
133 | str[start] = '\0'; | 133 | str[start] = '\0'; |
134 | } | 134 | } |
diff --git a/coreutils/tr.c b/coreutils/tr.c index d89b80bec..6d4cb4a14 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
@@ -153,7 +153,7 @@ static unsigned expand(const char *arg, char **buffer_p) | |||
153 | } | 153 | } |
154 | if (j == CLASS_punct || j == CLASS_cntrl) { | 154 | if (j == CLASS_punct || j == CLASS_cntrl) { |
155 | for (i = '\0'; i < ASCII; i++) { | 155 | for (i = '\0'; i < ASCII; i++) { |
156 | if ((j == CLASS_punct && isprint(i) && !isalnum(i) && !isspace(i)) | 156 | if ((j == CLASS_punct && isprint_asciionly(i) && !isalnum(i) && !isspace(i)) |
157 | || (j == CLASS_cntrl && iscntrl(i)) | 157 | || (j == CLASS_cntrl && iscntrl(i)) |
158 | ) { | 158 | ) { |
159 | buffer[pos++] = i; | 159 | buffer[pos++] = i; |