aboutsummaryrefslogtreecommitdiff
path: root/src/timezone/strftime.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-06-17 18:29:29 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-06-17 18:29:44 -0400
commit812a84d1cca1f8e43adc2e6a7dfe2ae83e2c1a29 (patch)
tree35a0aac9286afc8ffed5d6182464b1ce22dca9f4 /src/timezone/strftime.c
parentb91cfaa34f44386786c64bbf80d296b84ecc811e (diff)
downloadpostgresql-812a84d1cca1f8e43adc2e6a7dfe2ae83e2c1a29.tar.gz
postgresql-812a84d1cca1f8e43adc2e6a7dfe2ae83e2c1a29.zip
Sync our copy of the timezone library with IANA release tzcode2020a.
This absorbs a leap-second-related bug fix in localtime.c, and teaches zic to handle an expiration marker in the leapseconds file. Neither are of any interest to us (for the foreseeable future anyway), but we need to stay more or less in sync with upstream. Also adjust some over-eager changes in the README from commit 957338418. I have no intention of making changes that require C99 in this code, until such time as all the live back branches require C99. Otherwise back-patching will get too exciting. For the same reason, absorb assorted whitespace and other cosmetic changes from HEAD into the back branches; mostly this reflects use of improved versions of pgindent. All in all then, quite a boring update. But I figured I'd get it done while I was looking at this code.
Diffstat (limited to 'src/timezone/strftime.c')
-rw-r--r--src/timezone/strftime.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/timezone/strftime.c b/src/timezone/strftime.c
index 55c617f8c22..4b942c393a3 100644
--- a/src/timezone/strftime.c
+++ b/src/timezone/strftime.c
@@ -118,6 +118,12 @@ static char *_fmt(const char *, const struct pg_tm *, char *, const char *,
static char *_yconv(int, int, bool, bool, char *, char const *);
+/*
+ * Convert timestamp t to string s, a caller-allocated buffer of size maxsize,
+ * using the given format pattern.
+ *
+ * See also timestamptz_to_str.
+ */
size_t
pg_strftime(char *s, size_t maxsize, const char *format, const struct pg_tm *t)
{
@@ -499,7 +505,7 @@ _fmt(const char *format, const struct pg_tm *t, char *pt,
static char *
_conv(int n, const char *format, char *pt, const char *ptlim)
{
- char buf[INT_STRLEN_MAXIMUM(int) +1];
+ char buf[INT_STRLEN_MAXIMUM(int) + 1];
sprintf(buf, format, n);
return _add(buf, pt, ptlim);