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

Commit79588d3

Browse files
committed
Use SECS_PER_HOUR macro in tzparser.c, instead of constants
Reported-by: CharSyamDiscussion:https://postgr.es/m/CAMrLSE5j_aWfoBDMrSvk14oBKSy+-2cjzNNH_FciirA7Kwo9TA@mail.gmail.comAuthor: CharSyamBackpatch-through: master
1 parent9890a85 commit79588d3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/backend/utils/misc/tzparser.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include"utils/guc.h"
3030
#include"utils/memutils.h"
3131
#include"utils/tzparser.h"
32+
#include"utils/datetime.h"
3233

3334

3435
#defineWHITESPACE " \t\n\r"
@@ -66,8 +67,8 @@ validateTzEntry(tzEntry *tzentry)
6667
/*
6768
* Sanity-check the offset: shouldn't exceed 14 hours
6869
*/
69-
if (tzentry->offset>14*60*60||
70-
tzentry->offset<-14*60*60)
70+
if (tzentry->offset>14*SECS_PER_HOUR||
71+
tzentry->offset<-14*SECS_PER_HOUR)
7172
{
7273
GUC_check_errmsg("time zone offset %d is out of range in time zone file \"%s\", line %d",
7374
tzentry->offset,
@@ -155,7 +156,7 @@ splitTzLine(const char *filename, int lineno, char *line, tzEntry *tzentry)
155156
* zones that probably will never be used in the current session.
156157
*/
157158
tzentry->zone=pstrdup(offset);
158-
tzentry->offset=0;
159+
tzentry->offset=0*SECS_PER_HOUR;
159160
tzentry->is_dst= false;
160161
remain=strtok(NULL,WHITESPACE);
161162
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp