summaryrefslogtreecommitdiffstats
path: root/scripts/dtc/data.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2015-06-30 14:28:52 +0100
committerGrant Likely <grant.likely@linaro.org>2015-06-30 14:28:52 +0100
commitbecfc3c86df963491ff1d5ffc6131a06af6bb851 (patch)
tree4b60fb962445166025724b84ce13e7f1762df8a1 /scripts/dtc/data.c
parentce32f859646bab2ed724393398b90aa50149bb44 (diff)
parent0b34c1a489f6f018c4fbfbd12657acaa0b4f4ca9 (diff)
downloadop-kernel-dev-becfc3c86df963491ff1d5ffc6131a06af6bb851.zip
op-kernel-dev-becfc3c86df963491ff1d5ffc6131a06af6bb851.tar.gz
Merge remote-tracking branch 'robh/for-next' into devicetree/next
Diffstat (limited to 'scripts/dtc/data.c')
-rw-r--r--scripts/dtc/data.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/dtc/data.c b/scripts/dtc/data.c
index 4a40c5b..8cae237 100644
--- a/scripts/dtc/data.c
+++ b/scripts/dtc/data.c
@@ -74,7 +74,7 @@ struct data data_copy_escape_string(const char *s, int len)
struct data d;
char *q;
- d = data_grow_for(empty_data, strlen(s)+1);
+ d = data_grow_for(empty_data, len + 1);
q = d.val;
while (i < len) {
@@ -250,20 +250,20 @@ struct data data_add_marker(struct data d, enum markertype type, char *ref)
return data_append_markers(d, m);
}
-int data_is_one_string(struct data d)
+bool data_is_one_string(struct data d)
{
int i;
int len = d.len;
if (len == 0)
- return 0;
+ return false;
for (i = 0; i < len-1; i++)
if (d.val[i] == '\0')
- return 0;
+ return false;
if (d.val[len-1] != '\0')
- return 0;
+ return false;
- return 1;
+ return true;
}
OpenPOWER on IntegriCloud