diff options
author | Andrei Errapart <andrei@errapartengineering.com> | 2014-06-19 21:05:11 +1000 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2014-06-19 21:05:34 +1000 |
commit | 25a9bd6267bf1a2e144344325a71432193eed4b0 (patch) | |
tree | 31ef7917168871bc8b37c1d752b02378218f7736 /treesource.c | |
parent | fa928fba7e1ce94aef58798e77a9261192fdbb01 (diff) | |
download | device-tree-compiler-25a9bd6267bf1a2e144344325a71432193eed4b0.tar.gz |
Correct write_propval_bytes() for platforms with signed char by default
Some platforms (including the Microsoft C compiler) have char defaulting
to signed. write_propval_bytes() in the -O dts code will not behave
correctly in this case, due to sign extension.
Signed-off-by: Andrei Errapart <andrei@errapartengineering.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'treesource.c')
-rw-r--r-- | treesource.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/treesource.c b/treesource.c index 3a87b9f..a55d1d1 100644 --- a/treesource.c +++ b/treesource.c @@ -178,7 +178,7 @@ static void write_propval_bytes(FILE *f, struct data val) m = m->next; } - fprintf(f, "%02hhx", *bp++); + fprintf(f, "%02hhx", (unsigned char)(*bp++)); if ((const void *)bp >= propend) break; fprintf(f, " "); |