Found with -Wsizeof-pointer-memaccess.

Signed-off-by: Jussi Kukkonen <jussi.kukko...@intel.com>
---
 libmb/hash.c   | 2 +-
 libmb/mbmenu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libmb/hash.c b/libmb/hash.c
index 0226c7d..a867883 100644
--- a/libmb/hash.c
+++ b/libmb/hash.c
@@ -75,7 +75,7 @@ struct nlist *hash_add(struct hash *h, char *key, char *val)
 
 void hash_empty(struct hash *h)
 {
-   memset(h->hashtab, 0, sizeof(h->hashtab));
+   memset(h->hashtab, 0, sizeof(*h->hashtab));
 }
 
 void 
diff --git a/libmb/mbmenu.c b/libmb/mbmenu.c
index 5e4106e..6e35bed 100644
--- a/libmb/mbmenu.c
+++ b/libmb/mbmenu.c
@@ -1065,7 +1065,7 @@ static MBMenuMenu *
 new_menu(MBMenu *mb, char *title, int depth)
 {
   MBMenuMenu *menu = (MBMenuMenu *)malloc(sizeof(MBMenuMenu));
-   memset(menu, 0, sizeof(menu));
+   memset(menu, 0, sizeof(*menu));
    menu->items = NULL;
 
    MENUDBG("adding menu -> %s, (%i) \n", title, depth);
-- 
2.8.1

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to