mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-15 22:36:58 +00:00
Merge branch 'master' of git://git.denx.de/u-boot-fdt
This commit is contained in:
commit
d3909d74cc
1 changed files with 15 additions and 8 deletions
|
@ -574,14 +574,18 @@ static int fdt_parse_prop(char **newval, int count, char *data, int *len)
|
|||
* Byte stream. Convert the values.
|
||||
*/
|
||||
newp++;
|
||||
while ((*newp != ']') && (stridx < count)) {
|
||||
while ((stridx < count) && (*newp != ']')) {
|
||||
while (*newp == ' ')
|
||||
newp++;
|
||||
if (*newp == '\0') {
|
||||
newp = newval[++stridx];
|
||||
continue;
|
||||
}
|
||||
if (!isxdigit(*newp))
|
||||
break;
|
||||
tmp = simple_strtoul(newp, &newp, 16);
|
||||
*data++ = tmp & 0xFF;
|
||||
*len = *len + 1;
|
||||
while (*newp == ' ')
|
||||
newp++;
|
||||
if (*newp != '\0')
|
||||
newp = newval[++stridx];
|
||||
}
|
||||
if (*newp != ']') {
|
||||
printf("Unexpected character '%c'\n", *newp);
|
||||
|
@ -589,12 +593,15 @@ static int fdt_parse_prop(char **newval, int count, char *data, int *len)
|
|||
}
|
||||
} else {
|
||||
/*
|
||||
* Assume it is a string. Copy it into our data area for
|
||||
* convenience (including the terminating '\0').
|
||||
* Assume it is one or more strings. Copy it into our
|
||||
* data area for convenience (including the
|
||||
* terminating '\0's).
|
||||
*/
|
||||
while (stridx < count) {
|
||||
*len = strlen(newp) + 1;
|
||||
size_t length = strlen(newp) + 1;
|
||||
strcpy(data, newp);
|
||||
data += length;
|
||||
*len += length;
|
||||
newp = newval[++stridx];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue