Commit c9a52400 authored by Tom Lane's avatar Tom Lane

Use variable for format to suppress overly-anal-retentive gcc warning

about %c
parent 06b604b7
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001; * copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
* licence: BSD * licence: BSD
* *
* $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.1 2002/08/16 20:34:06 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.2 2002/08/18 02:48:41 tgl Exp $
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -49,6 +49,7 @@ main(int argc, char *argv[]) ...@@ -49,6 +49,7 @@ main(int argc, char *argv[])
crc64 crc; crc64 crc;
char pgctime_str[32]; char pgctime_str[32];
char ckpttime_str[32]; char ckpttime_str[32];
char *strftime_fmt = "%c";
if (argc > 1) if (argc > 1)
DataDir = argv[1]; DataDir = argv[1];
...@@ -87,9 +88,13 @@ main(int argc, char *argv[]) ...@@ -87,9 +88,13 @@ main(int argc, char *argv[])
"Either the file is corrupt, or it has a different layout than this program\n" "Either the file is corrupt, or it has a different layout than this program\n"
"is expecting. The results below are untrustworthy.\n\n"); "is expecting. The results below are untrustworthy.\n\n");
strftime(pgctime_str, 32, "%c", /*
* Use variable for format to suppress overly-anal-retentive gcc warning
* about %c
*/
strftime(pgctime_str, sizeof(pgctime_str), strftime_fmt,
localtime(&(ControlFile.time))); localtime(&(ControlFile.time)));
strftime(ckpttime_str, 32, "%c", strftime(ckpttime_str, sizeof(ckpttime_str), strftime_fmt,
localtime(&(ControlFile.checkPointCopy.time))); localtime(&(ControlFile.checkPointCopy.time)));
printf("pg_control version number: %u\n" printf("pg_control version number: %u\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment