summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-07-23 00:13:25 +0200
committerLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-07-23 00:13:25 +0200
commit079dbce33c5f064ae3eb1da0b8f3f1e8fed784a9 (patch)
treeb3aca4f39a24287c904e6fea285d2d95bf3eb109
parent93394b388f7cbec6640e361aa95c3b30ba2a90fc (diff)
CHECK_OOM: use print_error_nomem
-rw-r--r--src/io/read_file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/io/read_file.c b/src/io/read_file.c
index 99bea2a..219a395 100644
--- a/src/io/read_file.c
+++ b/src/io/read_file.c
@@ -4,14 +4,13 @@
#include <sys/stat.h>
#include <unistd.h>
+#include "util/error.h"
#include "read_file.h"
#include "global.h"
#define CHECK_OOM(ptr) \
if (ptr == NULL) { \
- fprintf(stderr, "%s: geheugen is op\n", progname); \
- /* I think I should free the original memory here, but whatever */ \
- return NULL; \
+ print_error_nomem(); \
}
struct filebuf *stream_to_filebuf(FILE *restrict stream, int openOptions) {