check for int value in uicb_tag_toggleview()
This commit is contained in:
parent
037d6aea59
commit
d46f740a39
10
tag.c
10
tag.c
|
@ -142,14 +142,20 @@ void
|
||||||
uicb_tag_toggleview(awesome_config *awesomeconf,
|
uicb_tag_toggleview(awesome_config *awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
int i, j;
|
||||||
int j;
|
|
||||||
|
|
||||||
i = arg ? atoi(arg) - 1: 0;
|
i = arg ? atoi(arg) - 1: 0;
|
||||||
|
|
||||||
|
if(i >= awesomeconf->ntags)
|
||||||
|
return;
|
||||||
|
|
||||||
awesomeconf->tags[i].selected = !awesomeconf->tags[i].selected;
|
awesomeconf->tags[i].selected = !awesomeconf->tags[i].selected;
|
||||||
|
|
||||||
|
/* check that there's at least one tag selected */
|
||||||
for(j = 0; j < awesomeconf->ntags && !awesomeconf->tags[j].selected; j++);
|
for(j = 0; j < awesomeconf->ntags && !awesomeconf->tags[j].selected; j++);
|
||||||
if(j == awesomeconf->ntags)
|
if(j == awesomeconf->ntags)
|
||||||
awesomeconf->tags[i].selected = True;
|
awesomeconf->tags[i].selected = True;
|
||||||
|
|
||||||
saveawesomeprops(awesomeconf);
|
saveawesomeprops(awesomeconf);
|
||||||
arrange(awesomeconf);
|
arrange(awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue