This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
tzset_r() bugfix for newlib-1.11.0
- From: Till Straumann <strauman at SLAC dot Stanford dot EDU>
- To: jjohnstn at redhat dot com
- Cc: newlib at sources dot redhat dot com,rtems-users mailing list <rtems-users at oarcorp dot com>
- Date: Fri, 30 May 2003 18:14:14 -0700
- Subject: tzset_r() bugfix for newlib-1.11.0
Hi.
I don't know if this has been reported already - if so,
I apologize for the WOB.
The attached patch fixes a bug in tzset_r(). The
sscanf() formats assume certain local variables to be
'short' but they had beed declared 'int' and hence
were not set correctly by sscanf().
Regards
-- Till
*** newlib-1.11.0/newlib/libc/time/tzset_r.c.orig Fri May 30 16:20:34 2003
--- newlib-1.11.0/newlib/libc/time/tzset_r.c Fri May 30 16:24:08 2003
***************
*** 28,34 ****
struct _reent *reent_ptr)
{
char *tzenv;
! int hh, mm, ss, sign, m, w, d, n;
int i, ch;
if ((tzenv = _getenv_r (reent_ptr, "TZ")) == NULL)
--- 28,35 ----
struct _reent *reent_ptr)
{
char *tzenv;
! unsigned short hh, mm, ss, m, w, d;
! int sign, n;
int i, ch;
if ((tzenv = _getenv_r (reent_ptr, "TZ")) == NULL)