* [Q] - BUG in strptime() DEC UNIX
@ 1996-03-18 5:00 Gareth Owen
1996-03-19 5:00 ` Stephen Carrier
0 siblings, 1 reply; 3+ messages in thread
From: Gareth Owen @ 1996-03-18 5:00 UTC (permalink / raw)
The strftime() function in DEC UNIX 3.0 (347) appears to behave strangely
when confronted by the 29th february.
When i try and convert the 29th feb (with or without a leap year as the
date) the function returns NULL (indicating error) but still correctly
fills the struct tm. If I pass in a date like 35th feb it correctly returns
NULL and doesn't fill the struct tm.
Is this a bug and is there a fix?
cheers
Gareth Owen
=============
code example:
{
char *conversion_end;
struct tm leap_time;
char time_string[BUFSIZ];
memset (&leap_time, 0, sizeof(leap_time));
conversion_end = strftime("29/02/96", "%d/%m/%y", &leap_time);
if (conversion_end == (char *)NULL)
{
printf("conversion failed\n");
}
else
{
printf("conversion succeeded\n");
}
strftime(time_string, BUFSIZ, "%d/%m/%y", &leap_time);
printf("%s\n", time_string);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Q] - BUG in strptime() DEC UNIX
1996-03-18 5:00 [Q] - BUG in strptime() DEC UNIX Gareth Owen
@ 1996-03-19 5:00 ` Stephen Carrier
1996-03-19 5:00 ` Jeff Finkelstein
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Carrier @ 1996-03-19 5:00 UTC (permalink / raw)
Gareth Owen (geo@spclmway.demon.co.uk) wrote:
: The strftime() function in DEC UNIX 3.0 (347) appears to behave strangely
: when confronted by the 29th february.
: When i try and convert the 29th feb (with or without a leap year as the
: date) the function returns NULL (indicating error) but still correctly
: fills the struct tm. If I pass in a date like 35th feb it correctly returns
: NULL and doesn't fill the struct tm.
: Is this a bug and is there a fix?
: cheers
: Gareth Owen
There is a publicly available patch to what I think is the same problem:
ftp://ftp.service.digital.com/public/osf/v2.0/clock_dunix1032d.tar
spc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Q] - BUG in strptime() DEC UNIX
1996-03-19 5:00 ` Stephen Carrier
@ 1996-03-19 5:00 ` Jeff Finkelstein
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Finkelstein @ 1996-03-19 5:00 UTC (permalink / raw)
Stephen Carrier wrote:
>
> There is a publicly available patch to what I think is the same problem:
>
> ftp://ftp.service.digital.com/public/osf/v2.0/clock_dunix1032d.tar
>
> spc
You can also get a Digital UNIX specific version from
atlanta.service.digital.com:/pub/patches/clockpatches/'os-version'
--
Jeff Finkelstein | "When you have excluded the impossible,
Digital Equipment Corporation | whatever remains, however improbable,
finkels@mindspring.com | must be the truth" - Arthur Conan Doyle
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-03-19 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-03-18 5:00 [Q] - BUG in strptime() DEC UNIX Gareth Owen
1996-03-19 5:00 ` Stephen Carrier
1996-03-19 5:00 ` Jeff Finkelstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox