fix gcc8 compiler warnings on string overflows (#905)

This commit is contained in:
pwpiwi 2020-01-03 07:17:21 +01:00 committed by GitHub
commit fef3084ec2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -1119,11 +1119,11 @@ int CmdHFList(const char *Cmd) {
prev_EOT = &previous_EOT;
}
char load_filename[FILE_PATH_SIZE] = {0};
char load_filename[FILE_PATH_SIZE+1] = {0};
if (loadFromFile) {
strncpy(load_filename, arg_get_str(5)->sval[0], FILE_PATH_SIZE);
}
char save_filename[FILE_PATH_SIZE] = {0};
char save_filename[FILE_PATH_SIZE+1] = {0};
if (saveToFile) {
strncpy(save_filename, arg_get_str(6)->sval[0], FILE_PATH_SIZE);
}