mirror of
https://github.com/swaywm/sway.git
synced 2026-04-17 06:46:32 -04:00
Use has_prefix() instead of strncmp() throughout
This is safer than hardcoded string lengths.
This commit is contained in:
parent
c55dff95bc
commit
0c60d1581f
19 changed files with 44 additions and 49 deletions
|
|
@ -121,8 +121,7 @@ static struct cmd_results *cmd_bind_or_unbind_gesture(int argc, char **argv, boo
|
|||
binding->flags |= BINDING_EXACT;
|
||||
} else if (strcmp("--no-warn", argv[0]) == 0) {
|
||||
warn = false;
|
||||
} else if (strncmp("--input-device=", argv[0],
|
||||
strlen("--input-device=")) == 0) {
|
||||
} else if (has_prefix("--input-device=", argv[0])) {
|
||||
free(binding->input);
|
||||
binding->input = strdup(argv[0] + strlen("--input-device="));
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue