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 --- editors/diff.c | 2 +- editors/vi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'editors') diff --git a/editors/diff.c b/editors/diff.c index e977f4d14..745ef0a33 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -749,7 +749,7 @@ static int asciifile(FILE *f) rewind(f); cnt = fread(g_read_buf, 1, COMMON_BUFSIZE, f); for (i = 0; i < cnt; i++) { - if (!isprint(g_read_buf[i]) + if (!isprint_asciionly(g_read_buf[i]) && !isspace(g_read_buf[i]) ) { return 0; diff --git a/editors/vi.c b/editors/vi.c index 6a6722875..7d83db642 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -30,9 +30,9 @@ #if ENABLE_LOCALE_SUPPORT #if ENABLE_FEATURE_VI_8BIT -#define Isprint(c) isprint(c) +# define Isprint(c) isprint(c) #else -#define Isprint(c) (isprint(c) && (unsigned char)(c) < 0x7f) +# define Isprint(c) (isprint(c) && (unsigned char)(c) < 0x7f) #endif #else -- cgit v1.2.3