Skip to content

Commit

Permalink
Merge branch 'prime'
Browse files Browse the repository at this point in the history
  • Loading branch information
jengelh committed Dec 29, 2023
2 parents 59bab00 + 5278a98 commit 3cb8306
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion exch/http/mod_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static BOOL mod_cache_parse_rfc1123_dstring(
tmp_tm = {};
if (strptime(dstring, "%a, %d %b %Y %T GMT", &tmp_tm) == nullptr)
return FALSE;
*pmtime = mktime(&tmp_tm);
*pmtime = timegm(&tmp_tm);
return TRUE;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/email/ical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,12 +1316,12 @@ bool ical_itime_to_utc(const ical_component *ptz_component,
tmp_tm.tm_wday = 0;
tmp_tm.tm_yday = 0;
tmp_tm.tm_isdst = 0;
*ptime = mktime(&tmp_tm);
*ptime = timegm(&tmp_tm);
if (ptz_component == nullptr)
return true;
/*
* @itime is anchored to @ptz_component. Conversion to tmp_tm did not
* change that. Because mktime() pretends @tmp_tm was UTC, @*ptime
* change that. Because timegm() assumes @tmp_tm was UTC, @*ptime
* now has bias which needs to be corrected.
*/
//assert(itime.type != ICT_UTC);
Expand Down Expand Up @@ -1353,7 +1353,7 @@ bool ical_datetime_to_utc(const ical_component *ptz_component,
tmp_tm.tm_wday = 0;
tmp_tm.tm_yday = 0;
tmp_tm.tm_isdst = 0;
*ptime = mktime(&tmp_tm);
*ptime = timegm(&tmp_tm);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/mail_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ BOOL parse_rfc822_timestamp(const char *str_time, time_t *ptime)
return FALSE;
}

tmp_time = mktime(&tmp_tm);
tmp_time = timegm(&tmp_tm);
tmp_time += factor*(60*60*hour + 60*minute);
*ptime = tmp_time;
return TRUE;
Expand Down
9 changes: 3 additions & 6 deletions lib/mapi/oxvcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ MESSAGE_CONTENT *oxvcard_import(const VCARD *pvcard, GET_PROPIDS get_propids) tr
continue;
memset(&tmp_tm, 0, sizeof(tmp_tm));
if (NULL != strptime(pstring, "%Y-%m-%d", &tmp_tm)) {
/* Conversion is not exact */
tmp_int64 = rop_util_unix_to_nttime(mktime(&tmp_tm));
tmp_int64 = rop_util_unix_to_nttime(timegm(&tmp_tm));
if (pmsg->proplist.set(PR_BIRTHDAY, &tmp_int64) != 0)
return imp_null;
}
Expand Down Expand Up @@ -463,8 +462,7 @@ MESSAGE_CONTENT *oxvcard_import(const VCARD *pvcard, GET_PROPIDS get_propids) tr
continue;
memset(&tmp_tm, 0, sizeof(tmp_tm));
if (NULL != strptime(pstring, "%Y-%m-%dT%H:%M:%S", &tmp_tm)) {
/* Conversion is not exact */
tmp_int64 = rop_util_unix_to_nttime(mktime(&tmp_tm));
tmp_int64 = rop_util_unix_to_nttime(timegm(&tmp_tm));
if (pmsg->proplist.set(PR_LAST_MODIFICATION_TIME, &tmp_int64) != 0)
return imp_null;
}
Expand Down Expand Up @@ -585,8 +583,7 @@ MESSAGE_CONTENT *oxvcard_import(const VCARD *pvcard, GET_PROPIDS get_propids) tr
continue;
memset(&tmp_tm, 0, sizeof(tmp_tm));
if (NULL != strptime(pstring, "%Y-%m-%d", &tmp_tm)) {
/* Conversion is not exact */
tmp_int64 = rop_util_unix_to_nttime(mktime(&tmp_tm));
tmp_int64 = rop_util_unix_to_nttime(timegm(&tmp_tm));
if (pmsg->proplist.set(PR_WEDDING_ANNIVERSARY, &tmp_int64) != 0)
return imp_null;
}
Expand Down
2 changes: 1 addition & 1 deletion mra/imap/imap_cmd_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ static BOOL imap_cmd_parser_convert_imaptime(const char *str_time, time_t *ptime
int minute = strtol(tmp_buff, nullptr, 0);
if (minute < 0 || minute > 59)
return FALSE;
tmp_time = mktime(&tmp_tm);
tmp_time = timegm(&tmp_tm);
tmp_time += factor*(60*60*hour + 60*minute);
*ptime = tmp_time;
return TRUE;
Expand Down

0 comments on commit 3cb8306

Please sign in to comment.