diff options
author | Jason Hobbs <jason.hobbs@calxeda.com> | 2011-08-23 11:06:54 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-10-17 22:25:34 +0200 |
commit | 4d91a6ecabd10652abba696e55e952676db0aae1 (patch) | |
tree | 27336d763e25ab047dc39c4b0c1a82a7bfc1d6ce /board/hymod/env.c | |
parent | ce2d4c9532b338e39f033ef75ae57bcb71c3389e (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.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/board/hymod/env.c b/board/hymod/env.c index c0e2cd5d68..fde428d979 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') { |