1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-14 05:23:01 +01:00

Use default timestamp format if provided one is invalid

This commit is contained in:
jfreegman 2018-04-10 17:47:21 -04:00
parent 7621fe9a62
commit a69fad15c1
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -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 */