Heyho, Hiltjo Posthuma wrote: > Here is a patch that improve the error messages a bit more and a patch that > checks a memory allocation case.
Thanks, I clarified the split error messages in the first one a bit. > Subject: [PATCH 2/2] check memory allocation for calloc, die on failure > > … > > - s->img = calloc(1, sizeof(Image)); > + s->img = ecalloc(1, sizeof(Image)); ecalloc does not call die() on failure. It just prints the errno string without a prefix and then returns NULL. Should we change that to call die() instead? It would simplify some cases in sent at least, where we currently call malloc/calloc and check the return code. Is there a case in the other projects where we don't want to die() on allocation failures? If there are just a few, they might switch back from ecalloc to calloc. Another option might be to introduce wecalloc like weprintf in sbase. --Markus