aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/file.c11
-rw-r--r--src/file.h3
-rw-r--r--src/loader.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/src/file.c b/src/file.c
index 7648340..5839949 100644
--- a/src/file.c
+++ b/src/file.c
@@ -48,3 +48,14 @@ blogc_file_get_contents(const char *path, size_t *len, blogc_error_t **err)
fclose(fp);
return b_string_free(str, false);
}
+
+
+int
+blogc_fprintf(FILE *stream, const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ int rv = vfprintf(stream, format, ap);
+ va_end(ap);
+ return rv;
+}
diff --git a/src/file.h b/src/file.h
index 5abdba7..5ff8dd0 100644
--- a/src/file.h
+++ b/src/file.h
@@ -9,11 +9,14 @@
#ifndef _FILE_H
#define _FILE_H
+#include <stdio.h>
+#include <stdlib.h>
#include "utils/utils.h"
#include "error.h"
#define BLOGC_FILE_CHUNK_SIZE 1024
char* blogc_file_get_contents(const char *path, size_t *len, blogc_error_t **err);
+int blogc_fprintf(FILE *stream, const char *format, ...);
#endif /* _FILE_H */
diff --git a/src/loader.c b/src/loader.c
index f868aeb..bcab0d6 100644
--- a/src/loader.c
+++ b/src/loader.c
@@ -138,7 +138,7 @@ blogc_source_parse_from_files(b_trie_t *conf, b_slist_t *l, blogc_error_t **err)
}
if (with_date > 0 && with_date < b_slist_length(l))
// fatal error, maybe?
- fprintf(stderr,
+ blogc_fprintf(stderr,
"blogc: warning: 'DATE' variable provided for at least one source "
"file, but not for all source files. This means that you may get "
"wrong values for 'DATE_FIRST' and 'DATE_LAST' variables.\n");