提交 4f26a486 编写于 作者: A aliguori

scsi-generic: correct usage of memset() (Laurent Vivier)

      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: NLaurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5291 c046a42c-6fe2-441c-8c8c-71466251a162
上级 ac4ffb5a
......@@ -548,8 +548,8 @@ static int get_blocksize(BlockDriverState *bdrv)
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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册