Skip to content

Commit 473e1fe

Browse files
committed
Prevent extra new line when not using buffer in zlog stream
1 parent 7f7465a commit 473e1fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sapi/fpm/fpm/zlog.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,12 @@ zlog_bool zlog_stream_finish(struct zlog_stream *stream) /* {{{ */
510510
#endif
511511
stream->buf[stream->len++] = '\n';
512512
zlog_stream_write(stream, stream->buf, stream->len);
513-
} else {
513+
} else if (!stream->finished) {
514514
zlog_stream_write(stream, "\n", 1);
515515
}
516516

517+
stream->finished = 1;
518+
517519
return 1;
518520
}
519521
/* }}} */

0 commit comments

Comments
 (0)