AmendHub

Download:

jcs

/

subtext

/

amendments

/

247

logger: Fix newline stripping


jcs made amendment 247 over 2 years ago
--- logger.c Thu Sep 8 22:08:48 2022 +++ logger.c Thu Sep 8 22:38:45 2022 @@ -294,8 +294,10 @@ logger_vprintf(struct logger *logger, const char *form if (len > sizeof(buf)) len = sizeof(buf); - while (buf[len - 1] == '\r') + while (buf[len - 1] == '\r') { + buf[len - 1] = '\0'; len--; + } if (logger->buffered_logs_len + len > LOGGER_BUFFERED_LOG_SIZE) logger_flush_buffer(logger);