Don't mung the user's tm_sec field if we don't need to. (Belt-and-suspenders

version.)

PR:		bin/27630
Submitted by:	Arthur David Olson <ado@nci.nih.gov>
Obtained from:	Timezone mailing-list <tz@elsie.nci.nih.gov>
MFC after:	1 month
This commit is contained in:
wollman 2001-06-05 20:13:28 +00:00
parent 0a20ee6fc7
commit f3e9e598b4

View File

@ -1449,7 +1449,9 @@ int * const okayp;
} }
if (increment_overflow(&yourtm.tm_year, -TM_YEAR_BASE)) if (increment_overflow(&yourtm.tm_year, -TM_YEAR_BASE))
return WRONG; return WRONG;
if (yourtm.tm_year + TM_YEAR_BASE < EPOCH_YEAR) { if (yourtm.tm_sec >= 0 && yourtm.tm_sec < SECSPERMIN)
saved_seconds = 0;
else if (yourtm.tm_year + TM_YEAR_BASE < EPOCH_YEAR) {
/* /*
** We can't set tm_sec to 0, because that might push the ** We can't set tm_sec to 0, because that might push the
** time below the minimum representable time. ** time below the minimum representable time.