Fix bug in -Odts with properties containing multiple terminating nulls
When in -Odts mode, dtc will not produce correct output for string-like properties which have more than one \0 character at the end of the property's bytestring. In fact, it generates output which is not syntactically correct. This patch fixes the bug, and adds a testcase for future regressions here. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
committed by
Jon Loeliger
parent
9c1a0df677
commit
c623fe5c21
11
tests/extra-terminating-null.dts
Normal file
11
tests/extra-terminating-null.dts
Normal file
@@ -0,0 +1,11 @@
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
extranull0 = "hello world";
|
||||
extranull1,1 = "hello world\0";
|
||||
extranull1,2 = "hello world", "";
|
||||
extranull2,1 = "hello world\0\0";
|
||||
extranull2,2 = "hello world", "", "";
|
||||
extranull2,3 = "hello world\0", "";
|
||||
extranull2,4 = "hello world", "\0";
|
||||
};
|
||||
Reference in New Issue
Block a user