On Wed, Jun 27, 2001 at 07:33:21AM -0400, Brad Giaccio wrote:
> On Wed, Jun 27, 2001 at 01:18:27PM +0200, Dominik Vogt wrote:
> > 
> > It crashes for me in this line:
> > 
> >   register double x = (double)((2 * i - t_width) * t_height) / 4.0;
> > 
> > with i = 0 and t_width = 255.  The problem is that i is an int
> > while t_width is an unsigned int.  The subtraction results in a
> > very large number.  This is used later to calculate an invalid
> > array index which causes the crash.
> > 
> 
> Well that makes sense.  I tried your fix and all is well for me now.
> Thanks gdb wasn't letting me look at register values for some reason
> so it was taking me a little longer to track down the problem.

I really hate that about C.  Everything looks fine, but it does
ridiculous type confersions without complaining.  That's why I
usually cast each and every variable in calculations nowadays.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, email: [EMAIL PROTECTED]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to