From 2637faa4509c78ac1463c7924f6e9f7cd96ed5d8 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Thu, 22 Mar 2012 08:48:28 +0200 Subject: [PATCH 1/1] Make test stripping locale independent --- test/bin/json_process.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/bin/json_process.c b/test/bin/json_process.c index 29cf4b5..40183c7 100644 --- a/test/bin/json_process.c +++ b/test/bin/json_process.c @@ -24,6 +24,8 @@ #include /* for _O_BINARY */ #endif +#define l_isspace(c) ((c) == ' ' || (c) == '\n' || (c) == '\r' || (c) == '\t') + static int getenv_int(const char *name) { char *value, *end; @@ -47,14 +49,14 @@ static const char *strip(char *str) { size_t length; char *result = str; - while(*result && isspace(*result)) + while(*result && l_isspace(*result)) result++; length = strlen(result); if(length == 0) return result; - while(isspace(result[length - 1])) + while(l_isspace(result[length - 1])) result[--length] = '\0'; return result; -- 2.1.4