Skip to contentSkip to conversation

xenconsoled: fix timestamp log

PATCH New Kouya Shimura 1 participant 1 message Jun 23, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenconsoled: fix timestamp log

timestamp log is broken.
Also, xenconsoled might die with segfault.

tools/console/daemon/io.c +1 -1
diff -r 703ced548925 tools/console/daemon/io.c
@@ -127,7 +127,7 @@ static int write_with_timestamp(int fd, 
 	const char *last_byte = data + sz - 1;
 
 	while (data <= last_byte) {
-		const char *nl = memchr(data, '\n', sz);
+		const char *nl = memchr(data, '\n', last_byte + 1 - data);
 		int found_nl = (nl != NULL);
 		if (!found_nl)
 			nl = last_byte;

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