Skip to contentSkip to conversation

libblktap: Remove trailing null byte in xs_printf

PATCH New Kevin Wolf 1 participant 1 message Oct 2, 2008

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 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.

tools/blktap/lib/xs_api.c +1 -1
Index: xen-unstable.hg/tools/blktap/lib/xs_api.c
===================================================================
@@ -132,7 +132,7 @@ int xs_printf(struct xs_handle *h, const
 		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);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel