From 4b52a3871137abc1b3f84f4dd3dc8e5fcbb9f602 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 2 Oct 2008 12:56:55 +0100 Subject: libblktap: Remove trailing null byte in xs_printf xs_printf writes the terminating null byte of the passed string to Xenstore. When reading, the null byte is returned in the following form which confuses tools: sector-size = "512\000" This patch removes the null byte from the data to write. Signed-off-by: Kevin Wolf --- tools/blktap/lib/xs_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/blktap') diff --git a/tools/blktap/lib/xs_api.c b/tools/blktap/lib/xs_api.c index 370a44aa4d..93d1cb9160 100644 --- a/tools/blktap/lib/xs_api.c +++ b/tools/blktap/lib/xs_api.c @@ -132,7 +132,7 @@ int xs_printf(struct xs_handle *h, const char *dir, const char *node, return ENOMEM; } - ret = xs_write(h, XBT_NULL, path, buf, strlen(buf)+1); + ret = xs_write(h, XBT_NULL, path, buf, strlen(buf)); free(buf); free(path); -- cgit v1.2.3