diff options
-rw-r--r-- | sway/criteria.c | 4 |
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) { ++head; } name = calloc(head - namestart + 1, 1); - strncpy(name, namestart, head - namestart); + if (head != namestart) { + strncpy(name, namestart, head - namestart); + } // Parse token value skip_spaces(&head); value = NULL; |