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: <2914-Sat24Jul2004104537+0300-eliz AT gnu DOT org> <20040725013214 DOT 18573 DOT 00000172 AT mb-m22 DOT aol DOT com> In-Reply-To: <20040725013214.18573.00000172@mb-m22.aol.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 26 Message-ID: Date: Mon, 26 Jul 2004 06:48:33 +1200 NNTP-Posting-Host: 218.101.50.29 X-Complaints-To: abuse AT tsnz DOT net X-Trace: news02.tsnz.net 1090781324 218.101.50.29 (Mon, 26 Jul 2004 06:48:44 NZST) NNTP-Posting-Date: Mon, 26 Jul 2004 06:48:44 NZST Organization: TelstraClear To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Sterten wrote: > Eli wrote: > > >> only the final one, where it crashed > > > >Sure; but that's better than what you have now (which is nothing > >except guesses). > > I'm 90% sure, that it's the line which I posted, > m55:r--;if(R[r]!=1)goto m55; and then r becomes negative. > Then I assume r runs into array Sym[99][99] which was initialized > immediately before R99]. It should stop at Sym[16][16] which > should be the first entry which is =1. Then presumably r is > 0-99*99+16*16=-9545 (modulo modifications due to starting at 1 vs.0, > I'm too lazy to check this) Why don't you change the code then to read if (r<0) printf("Error: r is less than 0"); m55: do {r--} while (R[r]!=1); The original is supposed to count down the r value, and when r equals 1 it carries on. -- Paul Wilkins