fence: master - fence_tool: dump only the size of the buffer

David Teigland teigland@fedoraproject.org
Mon Mar 9 22:01:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/fence.git?p=fence.git;a=commitdiff;h=5300fc8e07c2297e295c4f7ebd9996fa1f064558
Commit:        5300fc8e07c2297e295c4f7ebd9996fa1f064558
Parent:        36cf04edd383fd8018c9fca515ed44c2d1f96399
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Mon Mar 9 16:51:21 2009 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Mon Mar 9 16:57:52 2009 -0500

fence_tool: dump only the size of the buffer

Avoid printing a bunch of \0's from unfilled buffers.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 fence/fence_tool/fence_tool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fence/fence_tool/fence_tool.c b/fence/fence_tool/fence_tool.c
index 74824c2..8ee5544 100644
--- a/fence/fence_tool/fence_tool.c
+++ b/fence/fence_tool/fence_tool.c
@@ -421,7 +421,7 @@ static void do_dump(void)
 	if (rv < 0)
 		die("can't communicate with fenced");
 
-	do_write(STDOUT_FILENO, buf, sizeof(buf));
+	do_write(STDOUT_FILENO, buf, strlen(buf));
 
 	exit(EXIT_SUCCESS);
 }



More information about the Cluster-cvs mailing list