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

Appearance settings

Commit 79588d3

Browse filesBrowse files
committed
Use SECS_PER_HOUR macro in tzparser.c, instead of constants
Reported-by: CharSyam Discussion: https://postgr.es/m/CAMrLSE5j_aWfoBDMrSvk14oBKSy+-2cjzNNH_FciirA7Kwo9TA@mail.gmail.com Author: CharSyam Backpatch-through: master
1 parent 9890a85 commit 79588d3
Copy full SHA for 79588d3

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed

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

Copy file name to clipboardExpand all lines: src/backend/utils/misc/tzparser.c
+4-3Lines 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
#define WHITESPACE " \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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.