summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-05-24 20:45:54 -0300
committerEuAndreh <eu@euandre.org>2024-05-24 20:59:27 -0300
commit48939391bdb9dd53ac2e664568e5991a9bc47543 (patch)
treec89d66e310e10e6de95f1fc45eb97a1e6c283c7b /src/util.c
parentsrc/vector.h: Add implementation and tests for vector_contains() (diff)
downloadpindaiba-48939391bdb9dd53ac2e664568e5991a9bc47543.tar.gz
pindaiba-48939391bdb9dd53ac2e664568e5991a9bc47543.tar.xz
Remove all remaining calls to logerr() that included a trailing newline
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c14
1 files changed, 7 insertions, 7 deletions
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;
}
}