fix GCC 10 warnings

This commit is contained in:
Niclas Antti
2020-07-27 10:42:38 +03:00
parent fa40845e0c
commit ffb237628c
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ static int secrets_random_str(unsigned char* output, int len)
static MAXKEYS* secrets_readKeys(const char* path)
{
static const char NAME[] = ".secrets";
char secret_file[PATH_MAX + 1 + sizeof(NAME)]; // Worst case: maximum path + "/" + name.
char secret_file[PATH_MAX + 1 + sizeof(NAME) + 1]; // Worst case: maximum path + "/" + name+ '\0'
MAXKEYS* keys;
struct stat secret_stats;
static int reported = 0;
@ -256,7 +256,7 @@ int secrets_write_keys(const char* dir)
return 1;
}
snprintf(secret_file, PATH_MAX + 9, "%s/.secrets", dir);
snprintf(secret_file, PATH_MAX + 10, "%s/.secrets", dir);
clean_up_pathname(secret_file);
/* Open for writing | Create | Truncate the file for writing */