amiga-tz/library/time_timeoff.c

19 lines
375 B
C

#include "time_header.h"
time_t timeoff(struct tm *const tmp, long offset)
{
time_t t;
if ((offset > 0 && offset > INT_FAST32_MAX) ||
(offset < 0 && offset < INT_FAST32_MIN)) {
errno = EOVERFLOW;
return -1;
}
if (tmp != NULL)
tmp->tm_isdst = 0;
t = time1(tmp, gmtsub, gmtptr, (int_fast32_t)offset);
return t;
}