diff options
Diffstat (limited to 'src/pacman/util.h')
-rw-r--r-- | src/pacman/util.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/pacman/util.h b/src/pacman/util.h index b4a9d130..f9d8d847 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -21,10 +21,17 @@ #ifndef _PM_UTIL_H #define _PM_UTIL_H -#define MALLOC(p, b) do { if((b) > 0) { \ - p = malloc(b); if (!(p)) { \ - fprintf(stderr, "malloc failure: could not allocate %d bytes\n", b); \ - exit(1); }} else p = NULL; } while(0) +#define MALLOC(p, b) do { \ + if((b) > 0) { \ + p = malloc(b); \ + if (!(p)) { \ + fprintf(stderr, "malloc failure: could not allocate %d bytes\n", b); \ + exit(1); \ + } \ + } else { \ + p = NULL; \ + } \ +} while(0) #define FREE(p) do { if (p) { free(p); (p) = NULL; }} while(0) |