All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@suse.de>
To: xen-devel@lists.xensource.com
Subject: [PATCH] libblktap: Remove trailing null byte in xs_printf
Date: Thu, 02 Oct 2008 13:51:19 +0200	[thread overview]
Message-ID: <48E4B5B7.1080209@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

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 <kwolf@suse.de>

[-- Attachment #2: fix-xs_printf.patch --]
[-- Type: text/x-patch, Size: 441 bytes --]

Index: xen-unstable.hg/tools/blktap/lib/xs_api.c
===================================================================
--- xen-unstable.hg.orig/tools/blktap/lib/xs_api.c
+++ 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);

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2008-10-02 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48E4B5B7.1080209@suse.de \
    --to=kwolf@suse.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.