mirror of
https://github.com/postgres/postgres.git
synced 2025-05-12 16:21:30 +03:00
Avoid non-constant format string argument to fprintf().
As Tom Lane pointed out, it could defeat the compiler's printf() format string verification. Backpatch to v12, like that patch that introduced it. Discussion: https://www.postgresql.org/message-id/1069283.1597672779%40sss.pgh.pa.us
This commit is contained in:
parent
4f47c8e7d4
commit
aecefffc3f
@ -801,7 +801,7 @@ progress_report(int tablespacenum, const char *filename,
|
|||||||
* Stay on the same line if reporting to a terminal and we're not done
|
* Stay on the same line if reporting to a terminal and we're not done
|
||||||
* yet.
|
* yet.
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, (!finished && isatty(fileno(stderr))) ? "\r" : "\n");
|
fputc((!finished && isatty(fileno(stderr))) ? '\r' : '\n', stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32
|
static int32
|
||||||
|
@ -165,7 +165,7 @@ progress_report(bool finished)
|
|||||||
* Stay on the same line if reporting to a terminal and we're not done
|
* Stay on the same line if reporting to a terminal and we're not done
|
||||||
* yet.
|
* yet.
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, (!finished && isatty(fileno(stderr))) ? "\r" : "\n");
|
fputc((!finished && isatty(fileno(stderr))) ? '\r' : '\n', stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -505,7 +505,7 @@ progress_report(bool finished)
|
|||||||
* Stay on the same line if reporting to a terminal and we're not done
|
* Stay on the same line if reporting to a terminal and we're not done
|
||||||
* yet.
|
* yet.
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, (!finished && isatty(fileno(stderr))) ? "\r" : "\n");
|
fputc((!finished && isatty(fileno(stderr))) ? '\r' : '\n', stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user