1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 03:56:45 +02:00

add setting option to disable timestamps

This commit is contained in:
Jfreegman
2014-06-28 20:33:46 -04:00
parent a2e6a25fc8
commit 97536d2a72
5 changed files with 33 additions and 3 deletions

View File

@ -58,6 +58,11 @@ struct tm *get_time(void)
/*Puts the current time in buf in the format of [HH:mm:ss] */
void get_time_str(uint8_t *buf, int bufsize)
{
if (user_settings->timestamps == TIMESTAMPS_OFF) {
buf[0] = '\0';
return;
}
const char *t = user_settings->time == TIME_12 ? "[%-I:%M:%S] " : "[%H:%M:%S] ";
strftime(buf, bufsize, t, get_time());
}