From a69fad15c1ee5737872f2b9649dc3f366914f9df Mon Sep 17 00:00:00 2001 From: jfreegman Date: Tue, 10 Apr 2018 17:47:21 -0400 Subject: [PATCH] Use default timestamp format if provided one is invalid --- src/misc_tools.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/misc_tools.c b/src/misc_tools.c index 5f604be..9111cd1 100644 --- a/src/misc_tools.c +++ b/src/misc_tools.c @@ -84,7 +84,10 @@ void get_time_str(char *buf, int bufsize) } const char *t = user_settings->timestamp_format; - strftime(buf, bufsize, t, get_time()); + + if (strftime(buf, bufsize, t, get_time()) == 0) { + strftime(buf, bufsize, TIMESTAMP_DEFAULT, get_time()); + } } /* Converts seconds to string in format HH:mm:ss; truncates hours and minutes when necessary */