Permalink
Browse files

Fix XRandR segfault issue. Closes issue #231.

  • Loading branch information...
1 parent 37c71b8 commit e33718002c4cc3ceda520fd70bdfd3ad9c7e89a7 @andrewshadura andrewshadura committed May 31, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 cmd/wmii/fns.h
View
@@ -27,22 +27,22 @@
with(int, __alive) \
with(Area*, __anext) \
for(s=0; _cond(s <= nscreens, 0); _cont(s++)) \
- for((a)=(s < nscreens ? (v)->areas[s] : v->floating), __anext=(a)->next; \
+ for((a)=(s < nscreens ? (v)->areas[s] : v->floating), __anext=((a)?(a)->next:NULL); \
_cond(a, 1); \
_cont(((a)=__anext) && (__anext=(a)->next)))
#define foreach_column(v, s, a) \
with(int, __alive) \
with(Area*, __anext) \
for(s=0; _cond(s < nscreens, 0); _cont(s++)) \
- for((a)=(v)->areas[s], __anext=(a)->next; \
+ for((a)=(v)->areas[s], __anext=((a)?(a)->next:NULL); \
_cond(a, 1); \
_cont(((a)=__anext) && (__anext=(a)->next)))
#define foreach_frame(v, s, a, f) \
with(Frame*, __fnext) \
foreach_area(v, s, a) \
- for((void)(((f)=(a)->frame) && (__fnext=(f)->anext)); \
+ for((void)(((f)=(a)->frame) && (__fnext=(f)?((f)->anext):NULL)); \
_cond(f, 2); \
_cont(((f)=__fnext) && (__fnext=(f)->anext)))

0 comments on commit e337180

Please sign in to comment.