[U-Boot] [PATCH 1/6] tools: env: replace WHITESPACE macro by isblank

Andreas Fenkart andreas.fenkart at digitalstrom.com
Fri Mar 11 09:39:35 CET 2016


Signed-off-by: Andreas Fenkart <andreas.fenkart at digitalstrom.com>
---
 tools/env/fw_env.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index ee17a69..bded9f6 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -15,6 +15,7 @@
 #include <env_flags.h>
 #include <fcntl.h>
 #include <linux/stringify.h>
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
@@ -36,8 +37,6 @@
 
 #define DIV_ROUND_UP(n, d)	(((n) + (d) - 1) / (d))
 
-#define WHITESPACE(c) ((c == '\t') || (c == ' '))
-
 #define min(x, y) ({				\
 	typeof(x) _min1 = (x);			\
 	typeof(y) _min2 = (y);			\
@@ -140,8 +139,8 @@ static char *fw_string_blank(char *s, int noblank)
 	int len = strlen(s);
 
 	for (i = 0; i < len; i++, s++) {
-		if ((noblank && !WHITESPACE(*s)) ||
-			(!noblank && WHITESPACE(*s)))
+		if ((noblank && !isblank(*s)) ||
+		    (!noblank && isblank(*s)))
 			break;
 	}
 	if (i == len)
-- 
2.7.0



More information about the U-Boot mailing list