diff options
author | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2024-07-23 00:13:25 +0200 |
---|---|---|
committer | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2024-07-23 00:13:25 +0200 |
commit | 079dbce33c5f064ae3eb1da0b8f3f1e8fed784a9 (patch) | |
tree | b3aca4f39a24287c904e6fea285d2d95bf3eb109 /src | |
parent | 93394b388f7cbec6640e361aa95c3b30ba2a90fc (diff) |
CHECK_OOM: use print_error_nomem
Diffstat (limited to 'src')
-rw-r--r-- | src/io/read_file.c | 5 |
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) { |