Miscellaneous string handling cleanup

This is mainly to prevent effectively spurious truncation warnings
in recent GCC versions.
This commit is contained in:
Ian Barwick
2019-04-10 16:18:56 +09:00
parent 99be03f000
commit 03b29908e2
3 changed files with 15 additions and 11 deletions

View File

@@ -1521,10 +1521,10 @@ get_ready_archive_files(PGconn *conn, const char *data_directory)
while ((arcdir_ent = readdir(arcdir)) != NULL)
{
struct stat statbuf;
char file_path[MAXPGPATH] = "";
char file_path[MAXPGPATH + sizeof(arcdir_ent->d_name)];
int basenamelen = 0;
snprintf(file_path, MAXPGPATH,
snprintf(file_path, sizeof(file_path),
"%s/%s",
archive_status_dir,
arcdir_ent->d_name);