From 5054264d93bff2ad54d909d796e93f3081ee9703 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 22 Mar 2024 22:12:55 -0400 Subject: Error messages --- src/utils.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index da3833c..da340db 100644 --- a/src/utils.c +++ b/src/utils.c @@ -177,14 +177,13 @@ char **file_readlines(const char *filename, size_t start, size_t limit, ReaderFn if (fp == NULL) { perror(filename); - fprintf(SYSERROR); + SYSERROR("failed to open %s for reading", filename); return NULL; } // Allocate buffer if ((buffer = calloc(OMC_BUFSIZ, sizeof(char))) == NULL) { - perror("line buffer"); - fprintf(SYSERROR); + SYSERROR("unable to allocate %d bytes for buffer", OMC_BUFSIZ); if (!use_stdin) { fclose(fp); } @@ -579,7 +578,6 @@ int xml_pretty_print_in_place(const char *filename, const char *pretty_print_pro return 0; pretty_print_failed: - fprintf(SYSERROR); if (fp) { fclose(fp); } -- cgit