🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs
Article #371

Re: Computer bugs in the year 2000 (do-it-yourself)

#371
From: Alexis Dimitriadis
Date: Wed, 30 Jan 1985 03:25
42 lines
2039 bytes
> 
> If you are really worried about timewrap breaking programs in subtle ways,
> then set your clock ahead now, and find the bugs.  That will give you several
> years to fix them.  If you are binary only, you might NEED several years
> to get you vendor to fix them! :-)
> -- 
> Duty Now for the Future
> 					Tim Smith
> 			ihnp4!wlbr!callan!tim or ihnp4!cithep!tim

  With most library functions, you do not need to reset the machine clock--
just call them with the right number of seconds, and see what they do.
(You might even catch some of the overflow problems that have been discussed
here).
  I attached a simple program that does that, just run it and give it
the number of years you want to go forward (or backward, if < 0),
or can substitute your pet functions for time() and ctime().
  E.g., I found that we DO have the bug in ctime that prints every year
after 2000 as year 2. (and without a trailing newline...)

			alexis @ reed

---------------------------
#include <stdio.h>
#include <sys/time.h>
#define YEAR 31536000  /* only roughly, but who cares */

main()

{
long time(), clock;
float increment;
char * ctime();

	time(&clock);
	fputs(ctime(&clock), stdout);

	while (scanf("%f", &increment) > 0) {
		clock += (long) (increment * YEAR);
		fputs(ctime(&clock), stdout);
	}
}
Technical Details
Message-ID: <874@reed.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxb!mhuxn!mhuxm!mhuxj!houxm!vax135!cornell!uw-beaver!tektronix!reed!alexis
References: <820@reed.UUCP> <20381@arizona.UUCP> <3363@ucla-cs.ARPA> <294@callan.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site reed.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxb!mhuxn!mhuxm!mhuxj!houxm!vax135!cornell!uw-beaver!tektronix!reed!alexis
From: alexis@reed.UUCP (Alexis Dimitriadis)
Newsgroups: net.bugs,net.flame,net.puzzle
Subject: Re: Computer bugs in the year 2000 (do-it-yourself)
Message-ID: <874@reed.UUCP>
Date: Tue, 29-Jan-85 22:25:59 EST
Article-I.D.: reed.874
Posted: Tue Jan 29 22:25:59 1985
Date-Received: Thu, 31-Jan-85 02:36:33 EST
References: <820@reed.UUCP> <20381@arizona.UUCP> <3363@ucla-cs.ARPA> <294@callan.UUCP>
Organization: Reed College, Portland, Oregon
Lines: 42