aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/template.c4
-rw-r--r--src/utils.c6
2 files changed, 4 insertions, 6 deletions
diff --git a/src/template.c b/src/template.c
index e046350..72c045b 100644
--- a/src/template.c
+++ b/src/template.c
@@ -30,7 +30,7 @@ void tpl_register(char *key, char **ptr) {
struct tpl_item *item = NULL;
item = calloc(1, sizeof(*item));
if (!item) {
- perror("unable to register tpl_item");
+ SYSERROR("unable to register tpl_item for %s", key);
exit(1);
}
item->key = strdup(key);
@@ -47,7 +47,7 @@ void tpl_free() {
SYSERROR("freeing template item key: %s", item->key);
guard_free(item->key);
}
- free(item);
+ SYSERROR("freeing template item: %p", item);
item->ptr = NULL;
}
guard_free(item);
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);
}