summaryrefslogtreecommitdiff
path: root/time/tzfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/tzfile.c')
-rw-r--r--time/tzfile.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/time/tzfile.c b/time/tzfile.c
index d7e391c3a3..eddc0f825a 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -113,6 +113,9 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
size_t tzspec_len;
char *new = NULL;
+ _Static_assert (sizeof (time_t) == 8,
+ "time_t must be eight bytes");
+
_Static_assert (sizeof (__time64_t) == 8,
"__time64_t must be eight bytes");
@@ -635,16 +638,10 @@ __tzfile_compute (__time64_t timer, int use_localtime,
/* Convert to broken down structure. If this fails do not
use the string. */
- {
- time_t truncated = timer;
- if (__glibc_unlikely (truncated != timer
- || ! __offtime (&truncated, 0, tp)))
- goto use_last;
- }
-
- /* Use the rules from the TZ string to compute the change.
- timer fits into time_t due to the truncation check
- above. */
+ if (__glibc_unlikely (! __offtime (timer, 0, tp)))
+ goto use_last;
+
+ /* Use the rules from the TZ string to compute the change. */
__tz_compute (timer, tp, 1);
/* If tzspec comes from posixrules loaded by __tzfile_default,