hotfix of idxoftag
authoranselm@anselm1
Sat, 22 Mar 2008 16:53:37 +0000
changeset 1157 5fb97aa00e2f
parent 1156 987c8d5c0bf8
child 1158 7c40610de8df
hotfix of idxoftag
dwm.c
--- a/dwm.c	Sat Mar 22 12:47:12 2008 +0000
+++ b/dwm.c	Sat Mar 22 16:53:37 2008 +0000
@@ -259,7 +259,7 @@
 	XGetClassHint(dpy, c->win, &ch);
 	for(i = 0; i < LENGTH(rules); i++) {
 		r = &rules[i];
-		if(r->title && strstr(c->name, r->title)
+		if((r->title && strstr(c->name, r->title))
 		|| (ch.res_class && r->class && strstr(ch.res_class, r->class))
 		|| (ch.res_name && r->instance && strstr(ch.res_name, r->instance)))
 		{
@@ -860,7 +860,7 @@
 idxoftag(const char *t) {
 	unsigned int i;
 
-	for(i = 0; (i < LENGTH(tags)) && strcmp(tags[i], t); i++);
+	for(i = 0; (i < LENGTH(tags)) && t && strcmp(tags[i], t); i++);
 	return (i < LENGTH(tags)) ? i : 0;
 }