A typo was found by gcc-4.8:
virtio_user.c:744:15: error: argument to 'sizeof' in 'memset' call is the
same expression as the destination; did you mean to dereference it?
[-Werror=sizeof-pointer-memaccess]
         sizeof(tq->tx_hdrs[sz - 1].header));
               ^

Signed-off-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
---
 virtio_user.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/virtio_user.c b/virtio_user.c
index 1074bd8..a5f81df 100644
--- a/virtio_user.c
+++ b/virtio_user.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 6WIND S.A.
+ * Copyright 2013-2014 6WIND S.A.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -741,7 +741,7 @@ virtio_alloc_txq(struct virtio_net_vring* tq, int sz)
        }
        /* Reserve a NULL header for NO OP on hypervisor side. */
        memset(tq->tx_hdrs[sz - 1].header, 0,
-              sizeof(tq->tx_hdrs[sz - 1].header));
+              sizeof(*tq->tx_hdrs[sz - 1].header));
        return 0;
 }

-- 
1.7.10.4

Reply via email to