small bugfix
authorAnselm R. Garbe <arg@suckless.org>
Thu, 22 Feb 2007 12:15:48 +0100
changeset 826 d900a3f821a3
parent 825 bef1854ce739
child 827 834476ae0f52
small bugfix
layout.c
tag.c
--- a/layout.c	Thu Feb 22 12:00:02 2007 +0100
+++ b/layout.c	Thu Feb 22 12:15:48 2007 +0100
@@ -120,11 +120,17 @@
 
 void
 incnmaster(const char *arg) {
-	int i = arg ? atoi(arg) : 0;
-	if((lt->arrange != tile) || (nmaster + i < 1)
-	|| (wah / (nmaster + i) <= 2 * BORDERPX))
-		return;
-	nmaster += i;
+	int i;
+
+	if(!arg)
+		nmaster = NMASTER;
+	else {
+		i = atoi(arg);
+		if((lt->arrange != tile) || (nmaster + i < 1)
+		|| (wah / (nmaster + i) <= 2 * BORDERPX))
+			return;
+		nmaster += i;
+	}
 	if(sel)
 		lt->arrange();
 	else
@@ -175,7 +181,7 @@
 
 void
 setlayout(const char *arg) {
-	unsigned int i;
+	int i;
 
 	if(!arg) {
 		for(i = 0; i < nlayouts && lt != &layout[i]; i++);
--- a/tag.c	Thu Feb 22 12:00:02 2007 +0100
+++ b/tag.c	Thu Feb 22 12:15:48 2007 +0100
@@ -108,7 +108,7 @@
 	if(!sel)
 		return;
 	for(i = 0; i < ntags; i++)
-		sel->tags[i] = arg ? False : True;
+		sel->tags[i] = arg != NULL;
 	i = arg ? atoi(arg) : 0;
 	if(i >= 0 && i < ntags)
 		sel->tags[i] = True;
@@ -135,7 +135,7 @@
 
 	i = arg ? atoi(arg) : 0;
 	seltag[i] = !seltag[i];
-	for(j = 0; j < ntags && !seltag[j]; i++);
+	for(j = 0; j < ntags && !seltag[j]; j++);
 	if(j == ntags)
 		seltag[i] = True; /* cannot toggle last view */
 	lt->arrange();
@@ -146,7 +146,7 @@
 	int i;
 
 	for(i = 0; i < ntags; i++)
-		seltag[i] = arg ? False : True;
+		seltag[i] = arg != NULL;
 	i = arg ? atoi(arg) : 0;
 	if(i >= 0 && i < ntags)
 		seltag[i] = True;