summaryrefslogtreecommitdiff
path: root/scripts/dtc/data.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2015-04-30 00:00:05 +0300
committerRob Herring <robh@kernel.org>2015-04-30 01:17:27 +0300
commit4760597116e34bd58f670d008ae7323653268fb4 (patch)
tree2b27799a1dfc5171c7d502cb2ffe094d93ecf7f8 /scripts/dtc/data.c
parentf1ec7187167ce225d2744b20a90afef5f10fd6cd (diff)
downloadlinux-4760597116e34bd58f670d008ae7323653268fb4.tar.xz
scripts/dtc: Update to upstream version 9d3649bd3be245c9
Sync dtc with upstream as of commit 9d3649bd3be2 (Add testcases for fdt_path_offset_namelen()). Signed-off-by: Rob Herring <robh@kernel.org> Cc: Grant Likely <grant.likely@linaro.org> Cc: devicetree@vger.kernel.org
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 4a40c5b92474..8cae23746882 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;
}