summaryrefslogtreecommitdiff
path: root/board/hymod/env.c
diff options
context:
space:
mode:
authorJason Hobbs <jason.hobbs@calxeda.com>2011-08-23 11:06:54 +0000
committerWolfgang Denk <wd@denx.de>2011-10-17 22:25:34 +0200
commit4d91a6ecabd10652abba696e55e952676db0aae1 (patch)
tree27336d763e25ab047dc39c4b0c1a82a7bfc1d6ce /board/hymod/env.c
parentce2d4c9532b338e39f033ef75ae57bcb71c3389e (diff)
Replace space and tab checks with isblank
These are various places I found that checked for conditions equivalent to isblank. Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
Diffstat (limited to 'board/hymod/env.c')
-rw-r--r--board/hymod/env.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/board/hymod/env.c b/board/hymod/env.c
index c0e2cd5d681..fde428d9799 100644
--- a/board/hymod/env.c
+++ b/board/hymod/env.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <linux/ctype.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -45,7 +46,7 @@ env_callback (uchar *name, uchar *value)
nn++;
}
- while (*nn == ' ' || *nn == '\t')
+ while (isblank(*nn))
nn++;
if ((nnl = strlen (nn)) == 0) {
@@ -61,7 +62,7 @@ env_callback (uchar *name, uchar *value)
nn[--nnl] = '\0';
}
- while (nnl > 0 && ((c = nn[nnl - 1]) == ' ' || c == '\t'))
+ while (nnl > 0 && isblank(nn[nnl - 1]))
nn[--nnl] = '\0';
if (nnl == 0) {
printf ("Empty name in global env file\n");
@@ -71,11 +72,11 @@ env_callback (uchar *name, uchar *value)
p = (char *)value;
q = nv;
- while ((c = *p) == ' ' || c == '\t')
+ while (isblank(*p))
p++;
nvl = strlen (p);
- while (nvl > 0 && ((c = p[nvl - 1]) == ' ' || c == '\t'))
+ while (nvl > 0 && isblank(p[nvl - 1]))
p[--nvl] = '\0';
while ((*q = *p++) != '\0') {