From 48939391bdb9dd53ac2e664568e5991a9bc47543 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 24 May 2024 20:45:54 -0300 Subject: Remove all remaining calls to logerr() that included a trailing newline --- src/util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 33307a6..e7a3823 100644 --- a/src/util.c +++ b/src/util.c @@ -22,18 +22,18 @@ slurp(const char *const filename, char **out) { file = fopen(filename, "r"); if (file == NULL) { - logerr("fopen(\"%s\"): %s\n", filename, strerror(errno)); + logerr("fopen(): %s", strerror(errno)); goto out; } if (fseek(file, 0L, SEEK_END)) { - logerr("fseek(): %s\n", strerror(errno)); + logerr("fseek(): %s", strerror(errno)); goto out; } const long lsize = ftell(file); if (lsize == -1) { - logerr("ftell(): %s\n", strerror(errno)); + logerr("ftell(): %s", strerror(errno)); goto out; } const size_t size = (size_t)lsize; @@ -41,18 +41,18 @@ slurp(const char *const filename, char **out) { errno = 0; rewind(file); if (errno) { - logerr("rewind(file): %s\n", strerror(errno)); + logerr("rewind(): %s", strerror(errno)); goto out; } str = malloc(size + NULL_TERMINATOR); if (str == NULL) { - logerr("malloc(%ld): %s\n", size + NULL_TERMINATOR, strerror(errno)); + logerr("malloc(): %s", strerror(errno)); goto out; } if (fread(str, sizeof(char), size, file) != size) { - logerr("fread(\"%s\"): %s\n", filename, strerror(errno)); + logerr("fread(): %s", strerror(errno)); goto out; } str[size] = '\0'; @@ -62,7 +62,7 @@ slurp(const char *const filename, char **out) { out: if (file != NULL) { if (fclose(file)) { - logerr("fclose(\"%s\"): %s\n", filename, strerror(errno)); + logerr("fclose(): %s", strerror(errno)); rc = -1; } } -- cgit v1.2.3