[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 28/29] device/net_io.c (net_getstat): cast arguments to memset()
From: |
Marin Ramesa |
Subject: |
[PATCH 28/29] device/net_io.c (net_getstat): cast arguments to memset() |
Date: |
Mon, 9 Dec 2013 23:57:43 +0100 |
* device/net_io.c (net_getstat) (memset) ((char *)status + addr_byte_count):
Cast to (void *).
(net_getstat) (memset) (addr_int_count * sizeof(int) - addr_byte_count): Cast
to size_t.
---
device/net_io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/device/net_io.c b/device/net_io.c
index 74c053c..d85ec63 100644
--- a/device/net_io.c
+++ b/device/net_io.c
@@ -1419,8 +1419,8 @@ printf ("net_getstat: count: %d, addr_int_count: %d\n",
memcpy((void *)status, (void *)ifp->if_address,
(size_t)addr_byte_count);
if (addr_byte_count < addr_int_count * sizeof(int))
- memset((char *)status + addr_byte_count, 0,
- (addr_int_count * sizeof(int)
+ memset((void *)((char *)status + addr_byte_count), 0,
+ (size_t)(addr_int_count * sizeof(int)
- addr_byte_count));
for (i = 0; i < addr_int_count; i++) {
--
1.8.1.4
- [PATCH 21/29] device/ds_routines.c (device_write_get): check if io_count is larger or equal to zero and cast it to size_t, (continued)
- [PATCH 21/29] device/ds_routines.c (device_write_get): check if io_count is larger or equal to zero and cast it to size_t, Marin Ramesa, 2013/12/09
- [PATCH 22/29] device/kmsg.c (kmsgread): check if io_count is larger or equal to zero and cast it to vm_size_t, Marin Ramesa, 2013/12/09
- [PATCH 23/29] device/kmsg.c (kmsgread, kmsg_read_done): cast arguments to memcpy(), Marin Ramesa, 2013/12/09
- [PATCH 24/29] device/kmsg.c (kmsg_read_done): check if amt is negative, Marin Ramesa, 2013/12/09
- [PATCH 25/29] device/net_io.c: remove forward declarations, Marin Ramesa, 2013/12/09
- [PATCH 26/29] device/net_io.c (net_getstat): check if addr_byte_count is negative, Marin Ramesa, 2013/12/09
- [PATCH 27/29] device/net_io.c (net_getstat): cast arguments to memcpy(), Marin Ramesa, 2013/12/09
- [PATCH 28/29] device/net_io.c (net_getstat): cast arguments to memset(),
Marin Ramesa <=
- [PATCH 29/29] device/subrs.c: use io_req_t instead of struct buf, Marin Ramesa, 2013/12/09