aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2025-01-07 18:50:11 +0100
committerFurkan Sahin <furkan-dev@proton.me>2025-01-07 18:50:11 +0100
commitffb21ebdbbf73c49fb2dfe736108e006c2398f3b (patch)
tree8f9ea3859afb508309148d406492fa66be598eac
parent86d128b708d76a76587d4ce796b567ba4be36e66 (diff)
Fix has_prefix() comparisons with 0
has_prefix() returns a bool, unlike strncmp() which returns an int. Fixes: 86d128b708d7 ("Use has_prefix() instead of strncmp() throughout") Closes: https://github.com/swaywm/sway/issues/8527
-rw-r--r--sway/commands/bind.c2
-rw-r--r--sway/commands/mark.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 0d934700..32d4f891 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -398,7 +398,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
list_t *split = split_string(argv[0], "+");
for (int i = 0; i < split->length; ++i) {
// Check for group
- if (has_prefix(split->items[i], "Group") == 0) {
+ if (has_prefix(split->items[i], "Group")) {
if (binding->group != XKB_LAYOUT_INVALID) {
free_sway_binding(binding);
list_free_items_and_destroy(split);
diff --git a/sway/commands/mark.c b/sway/commands/mark.c
index 81bf0e38..77c8d239 100644
--- a/sway/commands/mark.c
+++ b/sway/commands/mark.c
@@ -23,7 +23,7 @@ struct cmd_results *cmd_mark(int argc, char **argv) {
}
bool add = false, toggle = false;
- while (argc > 0 && has_prefix(*argv, "--") == 0) {
+ while (argc > 0 && has_prefix(*argv, "--")) {
if (strcmp(*argv, "--add") == 0) {
add = true;
} else if (strcmp(*argv, "--replace") == 0) {