Commit 4f26a4867cf09fc486cd68a1e05a018767290260
1 parent
ac4ffb5a
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: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5291 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
2 additions
and
2 deletions
hw/scsi-generic.c
| @@ -548,8 +548,8 @@ static int get_blocksize(BlockDriverState *bdrv) | @@ -548,8 +548,8 @@ static int get_blocksize(BlockDriverState *bdrv) | ||
| 548 | sg_io_hdr_t io_header; | 548 | sg_io_hdr_t io_header; |
| 549 | int ret; | 549 | int ret; |
| 550 | 550 | ||
| 551 | - memset(cmd, sizeof(cmd), 0); | ||
| 552 | - memset(buf, sizeof(buf), 0); | 551 | + memset(cmd, 0, sizeof(cmd)); |
| 552 | + memset(buf, 0, sizeof(buf)); | ||
| 553 | cmd[0] = READ_CAPACITY; | 553 | cmd[0] = READ_CAPACITY; |
| 554 | 554 | ||
| 555 | memset(&io_header, 0, sizeof(io_header)); | 555 | memset(&io_header, 0, sizeof(io_header)); |