Hi,

Theo Buehler wrote on Mon, Feb 01, 2016 at 06:23:33PM +0100:
> On Mon, Feb 01, 2016 at 05:41:25PM +0100, Theo Buehler wrote:
>> On Mon, Feb 01, 2016 at 05:17:03PM +0100, Michal Mazurek wrote:

>>>             mntbuf = calloc(argc, sizeof(struct statfs));
>>>             if (mntbuf == NULL)
>>> -                   err(1, NULL);
>>> +                   err(1, "calloc");

>> I disagree with the changes in this patch.  If either malloc or calloc
>> fails it will typically set errno to ENOMEM, so you'll
>> 
>> df: Cannot allocate memory
>> 
>> I don't think adding the information that it was malloc or calloc that
>> failed is helpful at all.

> Well, to be fair, it's done this way in the malloc manual,

Fixed, it was completely obvious that this was bad advice in the
manual.

The reason why the manual was written like that probably was that
the manual focusses on something else (preventing integer overflow
and memory leaks) and nobody ever considered style issues of error
messages.

Yours,
  Ingo

Reply via email to