fix more issues reported by coverity

This commit is contained in:
David Hrdlička
2020-01-15 18:48:22 +01:00
parent 94ba8ec38c
commit a575bd7e8b
9 changed files with 23 additions and 13 deletions

View File

@@ -309,7 +309,7 @@ config_read(wchar_t *fn)
/* Create a new section and insert it. */
ns = malloc(sizeof(section_t));
memset(ns, 0x00, sizeof(section_t));
strncpy(ns->name, sname, sizeof(ns->name));
strncpy(ns->name, sname, sizeof(ns->name) - 1);
list_add(&ns->list, &config_head);
/* New section is now the current one. */