diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2007-06-17 12:21:59 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2007-06-17 12:21:59 +0200 |
commit | e7dd7209b8b3c7fcf0a2ca681470d33a9cb09267 (patch) | |
tree | 31321f7469221dc75f61e4b70b5dd4b272a5ac6c | |
parent | 72d3076d685075808fa9b1533fbaf9ea385df289 (diff) |
inotail.c: emalloc should return void *
Also add the unlikely() to the check of the malloc retval.
This patch seems to have gotten lost during a merge.
-rw-r--r-- | inotail.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -63,11 +63,11 @@ static const struct option long_opts[] = { { NULL, 0, NULL, 0 } }; -static char *emalloc(size_t size) +static void *emalloc(size_t size) { - char *ret = malloc(size); + void *ret = malloc(size); - if (!ret) { + if (unlikely(!ret)) { fprintf(stderr, "Error: Failed to allocate %d bytes of memory (%s)\n", size, strerror(errno)); exit(EXIT_FAILURE); } |