Hi !

> for preventing the allocation of 0 bytes. How is malloc(0) expected
> to behave ? -- my 'malloc man page' does not tell anything about this,

I just looked. You are right, according to the manpage this seems undefined.
Comparing to the description of realloc I would expect that it returns NULL
upon call with (0). However it does not seem to be clearly defined (and even
for the realloc case there are broken libcs out there, don't know if there
were any for linux, but for some DOS compilers they definitely were), so I'd
rather catch the case explicitly.

CU, Andy

-- 
= Andreas Beck                    |  Email :  <[EMAIL PROTECTED]>        =

Reply via email to