about summary refs log tree commit diff
path: root/time/tzfile.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-02-03 09:55:41 +0100
committerFlorian Weimer <fweimer@redhat.com>2019-02-03 09:55:41 +0100
commit77c7d55ece0caaa39652e05158e18d8a9b4f6fbe (patch)
treec0ece835c04118e8af375a7eb875fdafeac21586 /time/tzfile.c
parentee9941f94ea838774c34f60b3397fba07a803d92 (diff)
downloadglibc-77c7d55ece0caaa39652e05158e18d8a9b4f6fbe.tar.gz
glibc-77c7d55ece0caaa39652e05158e18d8a9b4f6fbe.tar.xz
glibc-77c7d55ece0caaa39652e05158e18d8a9b4f6fbe.zip
time: Use int, not long int, for internal GMT offsets
The GMT offset can be outside the range of a 16-bit int type, which
is presumably the reason why long int was used in struct tm.  We
cannot change struct tm, but we can change the internal type for
the offset.
Diffstat (limited to 'time/tzfile.c')
-rw-r--r--time/tzfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/time/tzfile.c b/time/tzfile.c
index 24440a6a9c..a07e7c5037 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -35,7 +35,7 @@ static time_t tzfile_mtime;
 
 struct ttinfo
   {
-    long int offset;		/* Seconds east of GMT.  */
+    int offset;			/* Seconds east of GMT.  */
     unsigned char isdst;	/* Used to set tm_isdst.  */
     unsigned char idx;		/* Index into `zone_names'.  */
     unsigned char isstd;	/* Transition times are in standard time.  */
@@ -345,7 +345,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
 	/* Bogus index in data file.  */
 	goto lose;
       types[i].idx = c;
-      types[i].offset = (long int) decode (x);
+      types[i].offset = decode (x);
     }
 
   if (__glibc_unlikely (__fread_unlocked (zone_names, 1, chars, f) != chars))
@@ -491,7 +491,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
 
 void
 __tzfile_default (const char *std, const char *dst,
-		  long int stdoff, long int dstoff)
+		  int stdoff, int dstoff)
 {
   size_t stdlen = strlen (std) + 1;
   size_t dstlen = strlen (dst) + 1;