mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 21:43:02 +01:00
Use default timestamp format if provided one is invalid
This commit is contained in:
parent
7621fe9a62
commit
a69fad15c1
@ -84,7 +84,10 @@ void get_time_str(char *buf, int bufsize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *t = user_settings->timestamp_format;
|
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 */
|
/* Converts seconds to string in format HH:mm:ss; truncates hours and minutes when necessary */
|
||||||
|
Loading…
Reference in New Issue
Block a user