Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2cd6520

Browse files
committed
Fix compiler warning about format truncation
1 parentf1464c5 commit2cd6520

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/bin/pg_verify_checksums/pg_verify_checksums.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ scan_directory(char *basedir, char *subdir)
130130
DIR*dir;
131131
structdirent*de;
132132

133-
snprintf(path,MAXPGPATH,"%s/%s",basedir,subdir);
133+
snprintf(path,sizeof(path),"%s/%s",basedir,subdir);
134134
dir=opendir(path);
135135
if (!dir)
136136
{
@@ -140,13 +140,13 @@ scan_directory(char *basedir, char *subdir)
140140
}
141141
while ((de=readdir(dir))!=NULL)
142142
{
143-
charfn[MAXPGPATH];
143+
charfn[MAXPGPATH+1];
144144
structstatst;
145145

146146
if (skipfile(de->d_name))
147147
continue;
148148

149-
snprintf(fn,MAXPGPATH,"%s/%s",path,de->d_name);
149+
snprintf(fn,sizeof(fn),"%s/%s",path,de->d_name);
150150
if (lstat(fn,&st)<0)
151151
{
152152
fprintf(stderr,_("%s: could not stat file \"%s\": %m\n"),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp