Merge pull request #2119 from martinetd/gcc-strtruncation

sway/criteria: gcc string truncation warning fix
master
emersion 7 years ago committed by GitHub
commit acf71fe805
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save