On Wed, 16 Jul 2014 12:00:42 +0200
Markus Teich <markus.teich_AT_stusta.mhn.de> wrote:
> You can combine these, since free(NULL) does nothing.
>
> if (!(data = malloc(len)) || read(fd, data, len) != len) {
> free(data);
> return NULL;
> }
Cf. my version ;)
I love idiomatic C-code :D.
Cheers
FRIGN
--
FRIGN <dev_AT_frign.de>
Received on Wed Jul 16 2014 - 12:58:13 CEST