* [Qemu-devel] [PATCH] scsi-generic: correct usage of memset().
@ 2008-09-22 14:52 Laurent Vivier
2008-09-22 15:27 ` Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2008-09-22 14:52 UTC (permalink / raw)
To: qemu-devel@nongnu.org
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));
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] scsi-generic: correct usage of memset().
2008-09-22 14:52 [Qemu-devel] [PATCH] scsi-generic: correct usage of memset() Laurent Vivier
@ 2008-09-22 15:27 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2008-09-22 15:27 UTC (permalink / raw)
To: qemu-devel
Laurent Vivier wrote:
> 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.
>
Applied. Thanks.
Regards,
Anthony Liguori
> 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));
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-22 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-22 14:52 [Qemu-devel] [PATCH] scsi-generic: correct usage of memset() Laurent Vivier
2008-09-22 15:27 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).