jcs
/subtext
/amendments
/615
logger: Minor fixes, syslog_reinit returns nothing
jcs made amendment 615 9 months ago
--- logger.c Sat Dec 6 21:16:14 2025
+++ logger.c Thu Dec 11 21:56:24 2025
@@ -379,14 +379,14 @@ logger_vprintf(const char *format, va_list ap)
len = strftime(buf, sizeof(buf), "\r[%H:%M:%S] ", localtime(&now));
len += vsnprintf(buf + len, sizeof(buf) - len, format, ap);
- if (len > sizeof(buf)) {
+ if (len >= sizeof(buf)) {
buf[sizeof(buf) - 1] = ']';
buf[sizeof(buf) - 2] = '…';
buf[sizeof(buf) - 3] = '[';
len = sizeof(buf);
}
- while (buf[len - 1] == '\r') {
+ while (len > 0 && buf[len - 1] == '\r') {
buf[len - 1] = '\0';
len--;
}
@@ -535,7 +535,7 @@ syslog_deinit(void)
xfree(&syslog_send_buf);
}
-bool
+void
syslog_reinit(void)
{
syslog_deinit();
--- logger.h Tue May 14 16:32:28 2024
+++ logger.h Sun Dec 7 10:16:51 2025
@@ -44,6 +44,6 @@ void logger_update_title(void);
void syslog_init(void);
void syslog_deinit(void);
-bool syslog_reinit(void);
+void syslog_reinit(void);
#endif
\ No newline at end of file