X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Paul Wilkins User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: strange error References: <20040726055220 DOT 22465 DOT 00000447 AT mb-m11 DOT aol DOT com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 34 Message-ID: <6U5Nc.449$zS6.65197@news02.tsnz.net> Date: Mon, 26 Jul 2004 23:26:47 +1200 NNTP-Posting-Host: 218.101.50.29 X-Complaints-To: abuse AT tsnz DOT net X-Trace: news02.tsnz.net 1090841218 218.101.50.29 (Mon, 26 Jul 2004 23:26:58 NZST) NNTP-Posting-Date: Mon, 26 Jul 2004 23:26:58 NZST Organization: TelstraClear To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Paul Wilkins wrote: Do not post when tired. > Let's head back to the line where the trouble occurs, which I presume > you want to fix. > > m55:r--;if(R[r]!=1)goto m55; > > r gets decreased until R[r] = 1. > > That needs to be fixed so that r doesn't go below 0 > Is that right? > > In that case, let's count down to 0 and break out when we're successful. > > for (r; r>=0; r--) if (R[r]==0) break; Make that for (r; r>=0; r--) if (R[r]==1) break; > > or > > for (r; r>=0; r--) > if (R[r]==1) > break; // out of for loop If you don't want to check R[0] (ie. you use R[1] as your first entry) then change r>=0 to r>0 or r>=1 -- Paul Wilkins