mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-27 21:58:16 +01:00
Check argc>0 before strcasecmp. Should shortcircuit
This commit is contained in:
parent
3bc209fc9d
commit
3644d6f4d3
1 changed files with 5 additions and 11 deletions
|
@ -921,19 +921,13 @@ struct cmd_results *cmd_move(int argc, char **argv) {
|
||||||
--argc; ++argv;
|
--argc; ++argv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp(argv[0], "window") == 0 ||
|
if (argc > 0 && (strcasecmp(argv[0], "window") == 0 ||
|
||||||
strcasecmp(argv[0], "container") == 0) {
|
strcasecmp(argv[0], "container") == 0)) {
|
||||||
--argc;
|
--argc; ++argv;
|
||||||
if (argc > 0) {
|
|
||||||
++argv;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp(argv[0], "to") == 0) {
|
if (argc > 0 && strcasecmp(argv[0], "to") == 0) {
|
||||||
--argc;
|
--argc; ++argv;
|
||||||
if (argc > 0) {
|
|
||||||
++argv;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!argc) {
|
if (!argc) {
|
||||||
|
|
Loading…
Reference in a new issue