From: Laurent Vivier <Laurent.Vivier@bull.net>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] scsi-generic: correct usage of memset().
Date: Mon, 22 Sep 2008 16:52:32 +0200 [thread overview]
Message-ID: <1222095152.4151.6.camel@frecb07144> (raw)
void *memset(void *s, int c, size_t n);
DESCRIPTION
The memset() function fills the first n bytes of the
memory area
pointed to by s with the constant byte c."
Reported by Dietmar Maurer.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
---
hw/scsi-generic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: qemu/hw/scsi-generic.c
===================================================================
--- qemu.orig/hw/scsi-generic.c 2008-09-22 10:46:42.000000000 +0200
+++ qemu/hw/scsi-generic.c 2008-09-22 14:32:26.000000000 +0200
@@ -548,8 +548,8 @@ static int get_blocksize(BlockDriverStat
sg_io_hdr_t io_header;
int ret;
- memset(cmd, sizeof(cmd), 0);
- memset(buf, sizeof(buf), 0);
+ memset(cmd, 0, sizeof(cmd));
+ memset(buf, 0, sizeof(buf));
cmd[0] = READ_CAPACITY;
memset(&io_header, 0, sizeof(io_header));
next reply other threads:[~2008-09-22 14:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-22 14:52 Laurent Vivier [this message]
2008-09-22 15:27 ` [Qemu-devel] [PATCH] scsi-generic: correct usage of memset() Anthony Liguori
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=1222095152.4151.6.camel@frecb07144 \
--to=laurent.vivier@bull.net \
--cc=qemu-devel@nongnu.org \
/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.