In C99, malloc(0) is legal. From n869.txt :I´m actually aware how the standard approaches the issue, but my question was more directed to how FreeBSD "code style" approaches the issue.
%% If the size of the space requested is zero, the behavior is implementation-defined: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object. %%
As a side note, free(NULL) is also legal in C99.
Personally I feel that debugging would be easier if mallocing 0 bytes and free and realloc of NULL pointers would not spread.
Pete
_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "[EMAIL PROTECTED]"