X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/c4dee92d5d5ff5e77e29b8ba94ae3a505cb25bb0..1ed24e36e279c922d3366f6c3144570cc5f54d7a:/src/src/log.c diff --git a/src/src/log.c b/src/src/log.c index a01e9c59f..d11b933f9 100644 --- a/src/src/log.c +++ b/src/src/log.c @@ -806,7 +806,7 @@ log_write(unsigned int selector, int flags, const char *format, ...) { int paniclogfd; ssize_t written_len; -gstring gs = { .size = LOG_BUFFER_SIZE-1, .ptr = 0, .s = log_buffer }; +gstring gs = { .size = LOG_BUFFER_SIZE-2, .ptr = 0, .s = log_buffer }; gstring * g; va_list ap; @@ -952,11 +952,10 @@ DEBUG(D_any|D_v) } va_end(ap); - g->size = LOG_BUFFER_SIZE; g = string_catn(g, US"\n", 1); debug_printf("%s", string_from_gstring(g)); - gs.size = LOG_BUFFER_SIZE-1; /* Having used the buffer for debug output, */ + gs.size = LOG_BUFFER_SIZE-2; /* Having used the buffer for debug output, */ gs.ptr = 0; /* reset it for the real use. */ gs.s = log_buffer; } @@ -1038,6 +1037,8 @@ if ( flags & LOG_RECIPIENTS } } +/* actual size, now we are placing the newline (and space for NUL) */ +gs.size = LOG_BUFFER_SIZE; g = string_catn(g, US"\n", 1); string_from_gstring(g);