mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #2119 from martinetd/gcc-strtruncation
sway/criteria: gcc string truncation warning fix
This commit is contained in:
commit
acf71fe805
1 changed files with 3 additions and 1 deletions
|
@ -472,7 +472,9 @@ struct criteria *criteria_parse(char *raw, char **error_arg) {
|
||||||
++head;
|
++head;
|
||||||
}
|
}
|
||||||
name = calloc(head - namestart + 1, 1);
|
name = calloc(head - namestart + 1, 1);
|
||||||
strncpy(name, namestart, head - namestart);
|
if (head != namestart) {
|
||||||
|
strncpy(name, namestart, head - namestart);
|
||||||
|
}
|
||||||
// Parse token value
|
// Parse token value
|
||||||
skip_spaces(&head);
|
skip_spaces(&head);
|
||||||
value = NULL;
|
value = NULL;
|
||||||
|
|
Loading…
Reference in a new issue