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

Commit7344782

Browse files
committed
Avoid non-constant format string argument to fprintf().
As Tom Lane pointed out, it could defeat the compiler's printf() formatstring verification.Backpatch to v12, like that patch that introduced it.Discussion:https://www.postgresql.org/message-id/1069283.1597672779%40sss.pgh.pa.us
1 parent623a9ba commit7344782

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ progress_report(int tablespacenum, const char *filename,
860860
* Stay on the same line if reporting to a terminal and we're not done
861861
* yet.
862862
*/
863-
fprintf(stderr,(!finished&&isatty(fileno(stderr))) ?"\r" :"\n");
863+
fputc((!finished&&isatty(fileno(stderr))) ?'\r' :'\n',stderr);
864864
}
865865

866866
staticint32

‎src/bin/pg_checksums/pg_checksums.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ progress_report(bool finished)
166166
* Stay on the same line if reporting to a terminal and we're not done
167167
* yet.
168168
*/
169-
fprintf(stderr,(!finished&&isatty(fileno(stderr))) ?"\r" :"\n");
169+
fputc((!finished&&isatty(fileno(stderr))) ?'\r' :'\n',stderr);
170170
}
171171

172172
staticbool

‎src/bin/pg_rewind/pg_rewind.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ progress_report(bool finished)
572572
* Stay on the same line if reporting to a terminal and we're not done
573573
* yet.
574574
*/
575-
fprintf(stderr,(!finished&&isatty(fileno(stderr))) ?"\r" :"\n");
575+
fputc((!finished&&isatty(fileno(stderr))) ?'\r' :'\n',stderr);
576576
}
577577

578578
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp