summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/criteria.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/criteria.c b/sway/criteria.c
index a263485a..d9f09ecc 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -472,7 +472,9 @@ struct criteria *criteria_parse(char *raw, char **error_arg) {
472 ++head; 472 ++head;
473 } 473 }
474 name = calloc(head - namestart + 1, 1); 474 name = calloc(head - namestart + 1, 1);
475 strncpy(name, namestart, head - namestart); 475 if (head != namestart) {
476 strncpy(name, namestart, head - namestart);
477 }
476 // Parse token value 478 // Parse token value
477 skip_spaces(&head); 479 skip_spaces(&head);
478 value = NULL; 480 value = NULL;