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>main
parent
fa928fba7e
commit
25a9bd6267
|
@ -178,7 +178,7 @@ static void write_propval_bytes(FILE *f, struct data val)
|
||||||
m = m->next;
|
m = m->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(f, "%02hhx", *bp++);
|
fprintf(f, "%02hhx", (unsigned char)(*bp++));
|
||||||
if ((const void *)bp >= propend)
|
if ((const void *)bp >= propend)
|
||||||
break;
|
break;
|
||||||
fprintf(f, " ");
|
fprintf(f, " ");
|
||||||
|
|
Loading…
Reference in New Issue