mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Fill in the rest of the fields in the resulting struct tm
from strptime(3). Previously, they would get filled only for the %s specifier and as a side effect of using the the %Z specifier with a GMT time zone. PR: misc/48993 Approved by: markm (mentor) Silence on: -standards
This commit is contained in:
parent
6a897e3f7e
commit
764628c056
1 changed files with 3 additions and 2 deletions
|
|
@ -518,12 +518,13 @@ strptime(const char * __restrict buf, const char * __restrict fmt,
|
|||
struct tm * __restrict tm)
|
||||
{
|
||||
char *ret;
|
||||
time_t t;
|
||||
int gmt;
|
||||
|
||||
gmt = 0;
|
||||
ret = _strptime(buf, fmt, tm, &gmt);
|
||||
if (ret && gmt) {
|
||||
time_t t = timegm(tm);
|
||||
if (ret) {
|
||||
t = gmt ? timegm(tm) : mktime(tm);
|
||||
localtime_r(&t, tm);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue