🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.16k
Article #255

Re: DSI-32 : A problem in C - Help!

#255
From: Joe Devincentis
Date: Tue, 18 Feb 1986 03:03
21 lines
1120 bytes
[eat at joes]


As my modem is also eating things, I will be brief. 

The i variable is never initialized, making this loop dependent on Zuut for
luck.

      while ( i <= rlength )
       {
        x = x + xinc;
        y = y + yinc;
        i++;
       }
       printf ("%.6f\n",x);

Lint caught this for me right away.

					devoz@encore
					Joe DeVincentis
Technical Details
Message-ID: <278@encore.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!linus!encore!devoz
References: <352@utastro.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 beta 3/9/83; site encore.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!linus!encore!devoz
From: devoz@encore.UUCP (Joe Devincentis)
Newsgroups: net.micro.16k
Subject: Re: DSI-32 : A problem in C - Help!
Message-ID: <278@encore.UUCP>
Date: Mon, 17-Feb-86 22:03:32 EST
Article-I.D.: encore.278
Posted: Mon Feb 17 22:03:32 1986
Date-Received: Wed, 19-Feb-86 03:55:59 EST
References: <352@utastro.UUCP>
Reply-To: devoz@encore.UUCP (Joe Devincentis)
Distribution: net.micro.16kw
Organization: Encore Computer Corp., Marlboro, MA
Lines: 21
Keywords: Initialization of variables.  Lint caught it.
Summary: Simple code bug.