| tdie if malloc sizeof(Monitor) fails - dwm - [fork] customized build of dwm, th… | |
| git clone git://src.adamsgaard.dk/dwm | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| commit 61c3095f2f9b35a0b330b37c172daefae0278663 | |
| parent a72dc2fec277bb517adcb98edfb18f469333d980 | |
| Author: Anselm R Garbe <[email protected]> | |
| Date: Wed, 8 Jul 2009 16:05:36 +0100 | |
| die if malloc sizeof(Monitor) fails | |
| Diffstat: | |
| M dwm.c | 3 ++- | |
| 1 file changed, 2 insertions(+), 1 deletion(-) | |
| --- | |
| diff --git a/dwm.c b/dwm.c | |
| t@@ -1693,7 +1693,8 @@ updategeom(void) { | |
| #endif /* XINERAMA */ | |
| /* allocate monitor(s) for the new geometry setup */ | |
| for(i = 0; i < n; i++) { | |
| - m = (Monitor *)malloc(sizeof(Monitor)); | |
| + if(!(m = (Monitor *)malloc(sizeof(Monitor)))) | |
| + die("fatal: could not malloc() %u bytes\n", sizeof(Mon… | |
| m->next = newmons; | |
| newmons = m; | |
| } |