[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bb segfault - will someone please confirm?



On Tue, Apr 12, 2005 at 06:05:18PM -0400, Lennart Sorensen wrote:
...
> If you fix this bug, it seems to run perfectly all the way through:
> 
> tex.c line 95:
> Was: memset(zbuff, 0x55, (X_s * Y_s * sizeof(long)));
> Should be: memset(zbuff, 0x55, (X_s * Y_s * sizeof(int)));
> 
> Len Sorensen

[Nice debugging work!]

Wouldn't it be better to use a type that is explicitly 32 bits wide,
rather than relying on the compiler to use only 32 bits for an int?

If you just use int, it seems like you're making the same mistake that
the original authors did.  (Unless the code uses int everywhere and
doesn't care how many bits it holds, in which case the width doesn't
actually matter as long as ints are used consistently.)

In any case, thanks!

--Pete



Reply to: