aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/criteria.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/criteria.c b/sway/criteria.c
index 94751c5f..97cf667e 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -682,7 +682,7 @@ struct criteria *criteria_parse(char *raw, char **error_arg) {
682 } 682 }
683 name = calloc(head - namestart + 1, 1); 683 name = calloc(head - namestart + 1, 1);
684 if (head != namestart) { 684 if (head != namestart) {
685 strncpy(name, namestart, head - namestart); 685 memcpy(name, namestart, head - namestart);
686 } 686 }
687 // Parse token value 687 // Parse token value
688 skip_spaces(&head); 688 skip_spaces(&head);
@@ -709,7 +709,7 @@ struct criteria *criteria_parse(char *raw, char **error_arg) {
709 } 709 }
710 } 710 }
711 value = calloc(head - valuestart + 1, 1); 711 value = calloc(head - valuestart + 1, 1);
712 strncpy(value, valuestart, head - valuestart); 712 memcpy(value, valuestart, head - valuestart);
713 if (in_quotes) { 713 if (in_quotes) {
714 ++head; 714 ++head;
715 in_quotes = false; 715 in_quotes = false;
@@ -740,7 +740,7 @@ struct criteria *criteria_parse(char *raw, char **error_arg) {
740 ++head; 740 ++head;
741 int len = head - raw; 741 int len = head - raw;
742 criteria->raw = calloc(len + 1, 1); 742 criteria->raw = calloc(len + 1, 1);
743 strncpy(criteria->raw, raw, len); 743 memcpy(criteria->raw, raw, len);
744 return criteria; 744 return criteria;
745 745
746cleanup: 746cleanup: