1
1
Fork 0
mirror of https://github.com/swaywm/sway synced 2024-06-02 10:46:29 +02:00

sway/criteria: gcc string truncation warning fix

This commit is contained in:
Dominique Martinet 2018-06-08 21:58:40 +09:00
parent bf6ca69ae8
commit 720313e185

View File

@ -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;