[PATCH] write_propval_string: Use a list of strings instead of "\0" in a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



A string that contains '\0' can be written as a list of strings e.g.

	clock-names = "di0_pll\0di1_pll\0di0_sel\0di1_sel\0di2_sel\0di3_sel\0di0\0di1";

is equivalent to

	clock-names = "di0_pll", "di1_pll", "di0_sel", "di1_sel", "di2_sel", "di3_sel", "di0", "di1";

The latter is easier to read, to use this format instead.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
---
 treesource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/treesource.c b/treesource.c
index 33fedee82d58..de30188189fb 100644
--- a/treesource.c
+++ b/treesource.c
@@ -87,7 +87,7 @@ static void write_propval_string(FILE *f, const char *s, size_t len)
 			fprintf(f, "\\\"");
 			break;
 		case '\0':
-			fprintf(f, "\\0");
+			fprintf(f, "\", \"");
 			break;
 		default:
 			if (isprint((unsigned char)c))
-- 
2.39.2




[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux