diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-10-24 19:10:42 -0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-10-24 19:10:42 -0200 |
commit | b27251f29dbf35b2580df0586779bc3366cf2dad (patch) | |
tree | 132c9a4a7880f64d3552a3481c77a9a9f0323f86 /src/datetime-parser.c | |
parent | 7127defbaa3701fc3444feb3233401e2829fc1b6 (diff) | |
download | blogc-b27251f29dbf35b2580df0586779bc3366cf2dad.tar.gz blogc-b27251f29dbf35b2580df0586779bc3366cf2dad.tar.bz2 blogc-b27251f29dbf35b2580df0586779bc3366cf2dad.zip |
datetime-parser: fixed strptime error handling
Diffstat (limited to 'src/datetime-parser.c')
-rw-r--r-- | src/datetime-parser.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/datetime-parser.c b/src/datetime-parser.c index 1d39490..572c9f0 100644 --- a/src/datetime-parser.c +++ b/src/datetime-parser.c @@ -366,9 +366,10 @@ blogc_convert_datetime(const char *orig, const char *format, char buf[1024]; if (0 == strftime(buf, sizeof(buf), format, &t)) { - fprintf(stderr, "blogc: warning: Failed to format DATE variable, " - "FORMAT is too long: %s\n", format); - return b_strdup(orig); + *err = blogc_error_new_printf(BLOGC_ERROR_DATETIME_PARSER, + "Failed to format DATE variable, FORMAT is too long: %s", + format); + return NULL; } return b_strdup(buf); |