From 93394b388f7cbec6640e361aa95c3b30ba2a90fc Mon Sep 17 00:00:00 2001 From: Lieuwe Rooijakkers Date: Tue, 23 Jul 2024 00:02:27 +0200 Subject: global progname variable --- src/io/read_file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/io/read_file.c') diff --git a/src/io/read_file.c b/src/io/read_file.c index 2ff00a5..99bea2a 100644 --- a/src/io/read_file.c +++ b/src/io/read_file.c @@ -5,10 +5,11 @@ #include #include "read_file.h" +#include "global.h" #define CHECK_OOM(ptr) \ if (ptr == NULL) { \ - fprintf(stderr, "geheugen is op\n"); \ + fprintf(stderr, "%s: geheugen is op\n", progname); \ /* I think I should free the original memory here, but whatever */ \ return NULL; \ } @@ -35,7 +36,7 @@ struct filebuf *stream_to_filebuf(FILE *restrict stream, int openOptions) { sz += n; if (n != amount && !feof(stream)) { - fprintf(stderr, "fout tijdens lezen van standaard invoer.\n"); + fprintf(stderr, "%s: fout tijdens lezen van standaard invoer.\n", progname); free(buf); return NULL; } -- cgit v1.2.3-70-g09d2