gm

(orphaned) group manager using libcxb
git clone git://z3bra.org/gm
Log | Files | Refs | README | LICENSE

commit 780d9be568929b5899e9ac966eb3c0b2e8aefa93
parent ce5bd4621f4b8e8278111a6e2993371a74c8009f
Author: z3bra <willy@mailoo.org>
Date:   Mon Nov 17 01:17:53 2014

Fixed a few errors

Diffstat:
 Makefile | 4 ++--
 gm.c     | 8 +++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile @@ -2,11 +2,11 @@ PREFIX:=/usr MANPREFIX:=${PREFIX}/share/man -CC = gcc +CC ?= cc LD = ${CC} RM = rm GZ = gzip -CFLAGS += -std=c99 -pedantic -Wall -g -D_XOPEN_SOURCE -Os +CFLAGS += -std=c99 -pedantic -Wall -Os LDFLAGS += -lxcb -lxcb-keysyms .SUFFIXES: .c .o .1 .1.gz diff --git a/gm.c b/gm.c @@ -18,7 +18,6 @@ #include <stdlib.h> #include <err.h> #include <getopt.h> -#include <sys/shm.h> #include <xcb/xcb.h> #include <xcb/xcb_keysyms.h> #include <X11/keysym.h> @@ -505,7 +504,7 @@ xcb_keycode_t *getkeycode(xcb_keysym_t keysym) void grabkeys() { int i, j; - xcb_keycode_t *kc; + xcb_keycode_t *kc = NULL; for (i=0; i<LEN(keys); i++) { kc = getkeycode(keys[i].sym); @@ -518,7 +517,10 @@ void grabkeys() } xcb_flush(con); - free(kc); + if (kc) { + free(kc); + } + return; /* void */ }