Fix more GCC 8 build failures
Fixed string truncation warnings by reducing max parameter lengths by one where applicable. The binlogrouter filename lengths are slightly different so using memcpy to work around the warnings is an adequate "solution" until the root of the problem is solved. Removed unnecessary CMake policy settings from qc_sqlite. Adding a self-dependency on the source file of an external project has no effect and only caused warnings to be logged.
This commit is contained in:
@ -117,7 +117,7 @@ int ini_parse_file(FILE* file,
|
||||
end = find_char_or_comment(start + 1, ']');
|
||||
if (*end == ']') {
|
||||
*end = '\0';
|
||||
strncpy0(section, start + 1, sizeof(section));
|
||||
strncpy0(section, start + 1, sizeof(section) - 1);
|
||||
*prev_name = '\0';
|
||||
}
|
||||
else if (!error) {
|
||||
@ -141,7 +141,7 @@ int ini_parse_file(FILE* file,
|
||||
rstrip(value);
|
||||
|
||||
/* Valid name[=:]value pair found, call handler */
|
||||
strncpy0(prev_name, name, sizeof(prev_name));
|
||||
strncpy0(prev_name, name, sizeof(prev_name) - 1);
|
||||
if (!handler(user, section, name, value) && !error)
|
||||
error = lineno;
|
||||
}
|
||||
|
Reference in New Issue
Block a user