From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhnKi-00005d-SK for qemu-devel@nongnu.org; Mon, 22 Sep 2008 11:28:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhnKh-0008Vm-5i for qemu-devel@nongnu.org; Mon, 22 Sep 2008 11:28:16 -0400 Received: from [199.232.76.173] (port=53177 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhnKh-0008Vb-1O for qemu-devel@nongnu.org; Mon, 22 Sep 2008 11:28:15 -0400 Received: from an-out-0708.google.com ([209.85.132.246]:25599) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KhnKg-0007Ed-SG for qemu-devel@nongnu.org; Mon, 22 Sep 2008 11:28:14 -0400 Received: by an-out-0708.google.com with SMTP id d18so134978and.130 for ; Mon, 22 Sep 2008 08:28:14 -0700 (PDT) Message-ID: <48D7B951.9010802@codemonkey.ws> Date: Mon, 22 Sep 2008 10:27:13 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] scsi-generic: correct usage of memset(). References: <1222095152.4151.6.camel@frecb07144> In-Reply-To: <1222095152.4151.6.camel@frecb07144> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 > --- > 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)); > > > >