Introduction
Introduction Statistics Contact Development Disclaimer Help
simplification - 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 <[email protected]>
Date: Tue, 29 Jul 2008 19:02:49 +0100
simplification
Diffstat:
M 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, unsign…
XGetWindowProperty(dpy, w, ev.xselection.property, offset, 409…
AnyPropertyType, &typeret, &format, len, remai…
if(*len) {
- result = emallocz(sizeof(unsigned char) * *len);
+ result = malloc(sizeof(unsigned char) * *len);
memcpy(result, data, *len);
}
XDeleteProperty(dpy, w, ev.xselection.property);
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.