|
6 | 6 | * copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001; |
7 | 7 | * licence: BSD |
8 | 8 | * |
9 | | - * $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.1 2002/08/16 20:34:06 momjian Exp $ |
| 9 | + * $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.2 2002/08/18 02:48:41 tgl Exp $ |
10 | 10 | */ |
11 | 11 | #include"postgres.h" |
12 | 12 |
|
@@ -49,6 +49,7 @@ main(int argc, char *argv[]) |
49 | 49 | crc64crc; |
50 | 50 | charpgctime_str[32]; |
51 | 51 | charckpttime_str[32]; |
| 52 | +char*strftime_fmt="%c"; |
52 | 53 |
|
53 | 54 | if (argc>1) |
54 | 55 | DataDir=argv[1]; |
@@ -87,9 +88,13 @@ main(int argc, char *argv[]) |
87 | 88 | "Either the file is corrupt, or it has a different layout than this program\n" |
88 | 89 | "is expecting. The results below are untrustworthy.\n\n"); |
89 | 90 |
|
90 | | -strftime(pgctime_str,32,"%c", |
| 91 | +/* |
| 92 | + * Use variable for format to suppress overly-anal-retentive gcc warning |
| 93 | + * about %c |
| 94 | + */ |
| 95 | +strftime(pgctime_str,sizeof(pgctime_str),strftime_fmt, |
91 | 96 | localtime(&(ControlFile.time))); |
92 | | -strftime(ckpttime_str,32,"%c", |
| 97 | +strftime(ckpttime_str,sizeof(ckpttime_str),strftime_fmt, |
93 | 98 | localtime(&(ControlFile.checkPointCopy.time))); |
94 | 99 |
|
95 | 100 | printf("pg_control version number: %u\n" |
|