sselp

simple X selection printer to stdout
git clone git://git.suckless.org/sselp
Log | Files | Refs | README | LICENSE

commit 90934448fe2991df6f95e5b07ef62eb4f260957f
parent e0bf31718dd3167f9fe2dbc755f9ec1043fa51e2
Author: Anselm R Garbe <garbeam@gmail.com>
Date:   Tue, 29 Jul 2008 19:02:49 +0100

simplification
Diffstat:
sselp.c | 13+------------
1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/sselp.c b/sselp.c @@ -9,17 +9,6 @@ /* static */ -static void * -emallocz(unsigned int size) { - void *res = calloc(1, size); - - if(!res) { - fprintf(stderr, "fatal: could not malloc() %u bytes\n", size); - exit(EXIT_FAILURE); - } - return res; -} - static unsigned char * getselection(unsigned long offset, unsigned long *len, unsigned long *remain) { Display *dpy; @@ -47,7 +36,7 @@ getselection(unsigned long offset, unsigned long *len, unsigned long *remain) { XGetWindowProperty(dpy, w, ev.xselection.property, offset, 4096L, False, AnyPropertyType, &typeret, &format, len, remain, &data); if(*len) { - result = emallocz(sizeof(unsigned char) * *len); + result = malloc(sizeof(unsigned char) * *len); memcpy(result, data, *len); } XDeleteProperty(dpy, w, ev.xselection.property);