diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-09-09 03:21:14 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-09-09 03:21:14 +0200 |
commit | 9dd0fcbeaed19c362ed2d1071d2ea967572b67f4 (patch) | |
tree | d68199abeb776d12496925f3583c3af32326bb1f /src/blogc/loader.c | |
parent | d66ebfab3458172bd435b00c51e8b09e2510b4d4 (diff) | |
download | blogc-9dd0fcbeaed19c362ed2d1071d2ea967572b67f4.tar.gz blogc-9dd0fcbeaed19c362ed2d1071d2ea967572b67f4.tar.bz2 blogc-9dd0fcbeaed19c362ed2d1071d2ea967572b67f4.zip |
file: do not call fprintf directly
Diffstat (limited to 'src/blogc/loader.c')
-rw-r--r-- | src/blogc/loader.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/blogc/loader.c b/src/blogc/loader.c index e8de75d..754723b 100644 --- a/src/blogc/loader.c +++ b/src/blogc/loader.c @@ -166,12 +166,13 @@ blogc_source_parse_from_files(bc_trie_t *conf, bc_slist_t *l, bc_error_t **err) rv = bc_slist_append(rv, s); } - if (with_date > 0 && with_date < bc_slist_length(rv)) - // fatal error, maybe? - 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"); + if (with_date > 0 && with_date < bc_slist_length(rv)) { + *err = bc_error_new_printf(BLOGC_ERROR_LOADER, + "'DATE' variable provided for at least one source file, but not " + "for all source files. It must be provided for all files.\n"); + bc_slist_free_full(rv, (bc_free_func_t) bc_trie_free); + rv = NULL; + } bool first = true; for (bc_slist_t *tmp = rv; tmp != NULL; tmp = tmp->next) { |