mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-05 11:00:43 +09:00
tools: env: replace WHITESPACE macro by isblank
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
This commit is contained in:
parent
adcc90b401
commit
10667e15f4
7
tools/env/fw_env.c
vendored
7
tools/env/fw_env.c
vendored
@ -15,6 +15,7 @@
|
|||||||
#include <env_flags.h>
|
#include <env_flags.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <linux/stringify.h>
|
#include <linux/stringify.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@ -36,8 +37,6 @@
|
|||||||
|
|
||||||
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
|
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
|
||||||
|
|
||||||
#define WHITESPACE(c) ((c == '\t') || (c == ' '))
|
|
||||||
|
|
||||||
#define min(x, y) ({ \
|
#define min(x, y) ({ \
|
||||||
typeof(x) _min1 = (x); \
|
typeof(x) _min1 = (x); \
|
||||||
typeof(y) _min2 = (y); \
|
typeof(y) _min2 = (y); \
|
||||||
@ -140,8 +139,8 @@ static char *fw_string_blank(char *s, int noblank)
|
|||||||
int len = strlen(s);
|
int len = strlen(s);
|
||||||
|
|
||||||
for (i = 0; i < len; i++, s++) {
|
for (i = 0; i < len; i++, s++) {
|
||||||
if ((noblank && !WHITESPACE(*s)) ||
|
if ((noblank && !isblank(*s)) ||
|
||||||
(!noblank && WHITESPACE(*s)))
|
(!noblank && isblank(*s)))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == len)
|
if (i == len)
|
||||||
|
Loading…
Reference in New Issue
Block a user