delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/29/06:04:46

Subject: 1.12.m1 beta 3: Bad _timezone declaration (ctime.c,gettimeo.c)
To: dj AT ctron DOT com (DJ Delorie)
Date: Mon, 29 Aug 1994 11:16:56 +0200 (MET DST)
From: Henrik Storner <storner AT olicom DOT dk>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

The declaration of _timezone (and _altzone) in ctime.c is wrong. They are
declared as type 'time_t' which is an unsigned long. But these may very
well contain negative numbers, and should therefore be declared as type
'long'.

This is carried over in gettimeo.c, resulting in gettimeofday returning
strange values for tz_minuteswest when using TZ settings with negative
offsets.
-- 
Henrik Storner        | "Man is the best computer we can put aboard a space-
(storner AT olicom DOT dk)   |  craft ... and the only one that can be mass produced 
System Engineering    |  with unskilled labor."
Olicom Denmark        |                                   Wernher von Braun

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019