Source-Changes-D archive

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

Re: CVS commit: src/lib/libutil



On Sun, Dec 30, 2012 at 05:36:00PM +0000, David A. Holland wrote:
> Module Name:  src
> Committed By: dholland
> Date:         Sun Dec 30 17:36:00 UTC 2012
> 
> Modified Files:
>       src/lib/libutil: efun.c
> 
> Log Message:
> If malloc, calloc, or realloc returns NULL when a size of 0 was
> requested, which is allowed by pertinent standards, honor it instead
> of bombing.
> 
> Do not do this for calloc(x, y) where x != 0 && y != 0 but x*y == 0;
> in that case bomb.

The commit message is misleading. We expect calloc(x,y) to return NULL
if x!=0 && y!=0 && x*y==0.

Joerg


Home | Main Index | Thread Index | Old Index