qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] scsi-generic: correct usage of memset().


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] scsi-generic: correct usage of memset().
Date: Mon, 22 Sep 2008 10:27:13 -0500
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

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 <address@hidden>
---
 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));








reply via email to

[Prev in Thread] Current Thread [Next in Thread]