mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-20 01:40:18 -05:00
fix: undefined behaviour in tagmon and tagcrossmon
This commit is contained in:
parent
eb0607501d
commit
1cde4975c3
2 changed files with 3 additions and 2 deletions
|
|
@ -990,6 +990,7 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
|
|||
}
|
||||
} else if (strcmp(func_name, "tagmon") == 0) {
|
||||
func = tagmon;
|
||||
(*arg).ui = 0;
|
||||
(*arg).i = parse_direction(arg_value);
|
||||
(*arg).i2 = atoi(arg_value2);
|
||||
if ((*arg).i == UNDIR) {
|
||||
|
|
|
|||
|
|
@ -1068,7 +1068,7 @@ int32_t tagmon(const Arg *arg) {
|
|||
if (!m || !m->wlr_output->enabled)
|
||||
return 0;
|
||||
|
||||
uint32_t newtags = arg->ui ? arg->ui : arg->i2 ? c->tags : 0;
|
||||
uint32_t newtags = arg->ui != 0 ? arg->ui : arg->i2 != 0 ? c->tags : 1;
|
||||
uint32_t target;
|
||||
|
||||
if (c->mon == m) {
|
||||
|
|
@ -1730,4 +1730,4 @@ int32_t scroller_stack(const Arg *arg) {
|
|||
|
||||
arrange(selmon, false, false);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue