Subject: Re: The _weirdest_ segfault...
To: None <port-alpha@netbsd.org>
From: Peter Seebach <seebs@plethora.net>
List: port-alpha
Date: 05/17/2000 14:54:59
In message <Pine.GSO.4.21.0005172148040.10407-100000@sigma1.sm.luth.se>, Andrea
s Falck writes:
>> 	Out of curiosity, what value are you passing to malloc()?
>> 
>Of course, I forgot:
>
>temp = malloc((i + 1) * (sizeof(char)));
>
>It allocates memory for a token out of a whitespace-separated string.

I'd check what i is, Just In Case.

Do you have <stdlib.h> included?  Is there any possibility that you might
have mistakenly provided your own prototype for malloc?  malloc takes a
size_t, which is 64 bits on Alpha, and this has been known to surprise people
before.

Also, sizeof(char) is 1, and is always 1, and cannot be other than 1, and
has always been 1, and will always be 1, and can be safely omitted.  :)

-s