1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-06 09:26:44 +02:00

Remove lots of duplicate code related to printing timestamps

This commit is contained in:
jfreegman
2020-11-30 17:55:57 -05:00
parent 4330bf5867
commit 2fcbc4fa1c
22 changed files with 236 additions and 270 deletions

View File

@ -96,11 +96,16 @@ struct tm *get_time(void)
return timeinfo;
}
/*Puts the current time in buf in the format of [HH:mm:ss] */
void get_time_str(char *buf, int bufsize)
/* Puts the current time in buf in the format of specified by the config */
void get_time_str(char *buf, size_t bufsize)
{
if (buf == NULL || bufsize == 0) {
return;
}
*buf = 0;
if (user_settings->timestamps == TIMESTAMPS_OFF) {
buf[0] = '\0';
return;
}