delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/07/25/15:00:49.2

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Paul Wilkins <disk AT paradise DOT net DOT nz>
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>
Lines: 26
Message-ID: <ggTMc.250$zS6.47980@news02.tsnz.net>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019