aboutsummaryrefslogtreecommitdiff
path: root/src/common/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/helpers.c')
-rw-r--r--src/common/helpers.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/common/helpers.c b/src/common/helpers.c
index 4bf7301..4a3606a 100644
--- a/src/common/helpers.c
+++ b/src/common/helpers.c
@@ -4,9 +4,8 @@
#include <string.h>
void die_lz(int code, const char *msg) {
- if (code < 0) {
+ if (code < 0)
die(msg);
- }
}
void die(const char *msg) {
@@ -17,17 +16,19 @@ void die(const char *msg) {
void *safe_calloc(unsigned int i, size_t size) {
void *x = calloc(i, size);
- if (x == NULL) {
+
+ if (x == NULL)
die("abort: calloc()");
- }
+
return x;
}
void *safe_realloc(void *x, size_t size) {
void *p = realloc(x, size);
- if (x == NULL) {
+
+ if (x == NULL)
die("abort: realloc()");
- }
+
return p;
}