[net.micro.amiga] Bugs in Aztec C time functions.

drew@orsvax1.UUCP (Drew Lucy) (05/30/86)

While hacking together a UNIX like "calendar" program, I found a bug in the
Manx/Aztec C functions time() and/or localtime(). time() returns the system
date/time in encoded form. localtime() unpacks that coded form into a
structure which contains, among other things, a number representing the month
(tm_mon) and the day of the month (tm_mday). The problem is that on the last
day of any month these functions result in tm_mon = "correct value + 1" and
tm_mday = 0. Fortunately, this bug is easy to work around once you know about
it. It's hard to believe that Manx didn't test these functions under end of
month conditions.

By the way, although the documentation doesn't say so, it appears that tm_mon
is supposed to range from 0 to 11 and tm_mday is supposed to range from 1 to 
what ever the last day of the current month is.

One last item, in case there are non UNIX types out there in netland. The 
makefile for the Mandelbrot set generator in the examples directory doesn't 
work as supplied because somebody renamed their CLI "delete" command "rm". 
"rm" is used in the make file.

					Drew