Okey Dokey. With that being the case, it appears we should rethink
string_grow/string_make. If we get a length of 0, we should allocate 1 byte
and store '\0' in it (really storing '\0' is not necessary, but it is always
nice to initialize). We can still keep the length as being 0, but this way
it will be portable.
Does this sound ok?
Tanton
-----Original Message-----
From: Jarkko Hietaniemi
To: Gibbs Tanton - tgibbs
Cc: 'Josh Wilmes '; ''[EMAIL PROTECTED] ' '
Sent: 9/17/2001 2:26 PM
Subject: Re: "Automated" Purify Run
On Mon, Sep 17, 2001 at 02:18:16PM -0500, Gibbs Tanton - tgibbs wrote:
> The hourly should be fine...can you do me one other favor and run the
> following c snippet through Purify:
>
> int main() {
> char* c = (char*)malloc(0);
I can tell without Purify that malloc(0) is unportable.
(As is calling it without <stdlib.h> inclusion, but I'm being mean :-)
> printf( "%.*s\n", 0, c );
> return 0;
> }
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen