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

Commitaecefff

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 parent4f47c8e commitaecefff

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
@@ -801,7 +801,7 @@ progress_report(int tablespacenum, const char *filename,
801801
* Stay on the same line if reporting to a terminal and we're not done
802802
* yet.
803803
*/
804-
fprintf(stderr,(!finished&&isatty(fileno(stderr))) ?"\r" :"\n");
804+
fputc((!finished&&isatty(fileno(stderr))) ?'\r' :'\n',stderr);
805805
}
806806

807807
staticint32

‎src/bin/pg_checksums/pg_checksums.c

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

171171
staticbool

‎src/bin/pg_rewind/pg_rewind.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ progress_report(bool finished)
505505
* Stay on the same line if reporting to a terminal and we're not done
506506
* yet.
507507
*/
508-
fprintf(stderr,(!finished&&isatty(fileno(stderr))) ?"\r" :"\n");
508+
fputc((!finished&&isatty(fileno(stderr))) ?'\r' :'\n',stderr);
509509
}
510510

511511
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp