diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2022-12-19 21:09:17 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2022-12-19 22:46:15 +0000 |
commit | 1ed24e36e279c922d3366f6c3144570cc5f54d7a (patch) | |
tree | 9379afdc012a562c3c84ee028bc2c142cfb3fa48 /src | |
parent | c4dee92d5d5ff5e77e29b8ba94ae3a505cb25bb0 (diff) |
Fix logging of max-size log line
Broken-by: d12746bc15d8
Diffstat (limited to 'src')
-rw-r--r-- | src/src/log.c | 7 |
1 files changed, 4 insertions, 3 deletions
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); |