diff options
| author | Joe Hershberger <joe.hershberger@ni.com> | 2012-08-17 10:34:38 +0000 | 
|---|---|---|
| committer | Gerald Van Baren <gvb@unssw.com> | 2012-10-15 19:20:26 -0400 | 
| commit | 8805beec8f51e861996860db71a831e4c263cf4c (patch) | |
| tree | 08b3a373de1f5119f00473d1142de5e59b3ddb8a | |
| parent | bc80295b620c5abf9d4fb3b00846ef018e921540 (diff) | |
| download | olio-uboot-2014.01-8805beec8f51e861996860db71a831e4c263cf4c.tar.xz olio-uboot-2014.01-8805beec8f51e861996860db71a831e4c263cf4c.zip | |
fdt: Identify scripts in ITBs as printable strings
Scripts in the ITB format will have spaces in them and will end in a
newline charachter.  Make sure that these are considered printable.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
| -rw-r--r-- | common/cmd_fdt.c | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 299745237..a5e2cfcbf 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -754,12 +754,12 @@ static int is_printable_string(const void *data, int len)  	if (len == 0)  		return 0; -	/* must terminate with zero */ -	if (s[len - 1] != '\0') +	/* must terminate with zero or '\n' */ +	if (s[len - 1] != '\0' && s[len - 1] != '\n')  		return 0;  	/* printable or a null byte (concatenated strings) */ -	while (((*s == '\0') || isprint(*s)) && (len > 0)) { +	while (((*s == '\0') || isprint(*s) || isspace(*s)) && (len > 0)) {  		/*  		 * If we see a null, there are three possibilities:  		 * 1) If len == 1, it is the end of the string, printable |