aboutsummaryrefslogtreecommitdiff
path: root/src/IO
diff options
context:
space:
mode:
Diffstat (limited to 'src/IO')
-rw-r--r--src/IO/IO.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/IO/IO.c b/src/IO/IO.c
index 4b0285f2..1243c70a 100644
--- a/src/IO/IO.c
+++ b/src/IO/IO.c
@@ -369,8 +369,11 @@ void a_IO_ccc(int Op, int Branch, int Dir, ChainLink *Info,
case OpAbort:
io = Info->LocalKey;
if (io->Buf->len > 0) {
- MSG_WARN("IO_write, closing with pending data not sent\n");
- MSG_WARN(" \"%s\"\n", dStr_printable(io->Buf, 2048));
+ char *newline = memchr(io->Buf->str, '\n', io->Buf->len);
+ int msglen = newline ? newline - io->Buf->str : 2048;
+
+ MSG_WARN("IO_write, closing with pending data not sent: "
+ "\"%s\"\n", dStr_printable(io->Buf, msglen));
}
/* close FD, remove from ValidIOs and remove its watch */
IO_close_fd(io, Op == OpEnd ? IO_StopWr : IO_StopRdWr);