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

Commitc9a5240

Browse files
committed
Use variable for format to suppress overly-anal-retentive gcc warning
about %c
1 parent06b604b commitc9a5240

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎src/bin/pg_controldata/pg_controldata.c‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
77
* licence: BSD
88
*
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 $
1010
*/
1111
#include"postgres.h"
1212

@@ -49,6 +49,7 @@ main(int argc, char *argv[])
4949
crc64crc;
5050
charpgctime_str[32];
5151
charckpttime_str[32];
52+
char*strftime_fmt="%c";
5253

5354
if (argc>1)
5455
DataDir=argv[1];
@@ -87,9 +88,13 @@ main(int argc, char *argv[])
8788
"Either the file is corrupt, or it has a different layout than this program\n"
8889
"is expecting. The results below are untrustworthy.\n\n");
8990

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,
9196
localtime(&(ControlFile.time)));
92-
strftime(ckpttime_str,32,"%c",
97+
strftime(ckpttime_str,sizeof(ckpttime_str),strftime_fmt,
9398
localtime(&(ControlFile.checkPointCopy.time)));
9499

95100
printf("pg_control version number: %u\n"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp