git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f1464c5)
Fix compiler warning about format truncation
Fri, 6 Apr 2018 12:43:50 +0000 (08:43 -0400)
Fri, 6 Apr 2018 12:43:50 +0000 (08:43 -0400)

diff --git a/src/bin/pg_verify_checksums/pg_verify_checksums.c b/src/bin/pg_verify_checksums/pg_verify_checksums.c
index 3bdfb078bb9cd25c28c4bc70a7ef89827df6aeda..07271d02204348b51a990a236b50f7c076cf95f6 100644 (file)
--- a/src/bin/pg_verify_checksums/pg_verify_checksums.c
+++ b/src/bin/pg_verify_checksums/pg_verify_checksums.c
@@ -130,7 +130,7 @@ scan_directory(char *basedir, char *subdir)
DIR *dir;
struct dirent *de;
- snprintf(path, MAXPGPATH, "%s/%s", basedir, subdir);
+ snprintf(path, sizeof(path), "%s/%s", basedir, subdir);
dir = opendir(path);
if (!dir)
{
@@ -140,13 +140,13 @@ scan_directory(char *basedir, char *subdir)
}
while ((de = readdir(dir)) != NULL)
{
- char fn[MAXPGPATH];
+ char fn[MAXPGPATH + 1];
struct stat st;
if (skipfile(de->d_name))
continue;
- snprintf(fn, MAXPGPATH, "%s/%s", path, de->d_name);
+ snprintf(fn, sizeof(fn), "%s/%s", path, de->d_name);
if (lstat(fn, &st) < 0)
{
fprintf(stderr, _("%s: could not stat file \"%s\": %m\n"),
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /