From d7722348e27189c7722ccff0fa22e87491ba6bc7 Mon Sep 17 00:00:00 2001 From: Omar Sandoval Date: Wed, 26 Nov 2014 02:02:39 -0800 Subject: [PATCH 1/2] Zero out entire net_wm structures using memset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compiling with -Wall gives: misc.c: In function ‘get_net_wm_state’: misc.c:404:22: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess] bzero(nws, sizeof(nws)); This is fixed by using sizeof(*nws). Same fix in get_net_wm_window_type. Additionally, prefer memset over bzero. --- misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc.c b/misc.c index 7c54a9c..544a317 100644 --- a/misc.c +++ b/misc.c @@ -401,7 +401,7 @@ get_net_wm_state(Window win, net_wm_state *nws) ENTER; - bzero(nws, sizeof(nws)); + memset(nws, 0, sizeof(*nws)); if (!(state = get_xaproperty(win, a_NET_WM_STATE, XA_ATOM, &num3))) RET(); @@ -442,7 +442,7 @@ get_net_wm_window_type(Window win, net_wm_window_type *nwwt) ENTER; - bzero(nwwt, sizeof(nwwt)); + memset(nwwt, 0, sizeof(*nwwt)); if (!(state = get_xaproperty(win, a_NET_WM_WINDOW_TYPE, XA_ATOM, &num3))) RET(); From 5d87755292200c6b0750da3a264f8eea689cf9e6 Mon Sep 17 00:00:00 2001 From: Omar Sandoval Date: Wed, 26 Nov 2014 02:05:13 -0800 Subject: [PATCH 2/2] Ignore *.o, *.dep, executable --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index a536c41..cb8e4c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ Makefile.config config.h +*.o +*.dep +trayer