[libvirt] [PATCH] virbuffer: Set child buffer indent properly

There's this macro virBufferSetChildIndent which sets offset of child buffer from given parent buffer. However, it is calling virBufferAdjustIndent() which only adds adjustment instead of calling virBufferSetIndent() which clears out any adjustment previously set. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/util/virbuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index 4f5ed162fb..e95ee878a1 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -112,7 +112,7 @@ void virBufferSetIndent(virBufferPtr, int indent); * child buffer. */ # define virBufferSetChildIndent(childBuf_, parentBuf_) \ - virBufferAdjustIndent(childBuf_, virBufferGetIndent(parentBuf_, false) + 2) + virBufferSetIndent(childBuf_, virBufferGetIndent(parentBuf_, false) + 2) int virBufferGetIndent(const virBuffer *buf, bool dynamic); -- 2.16.1

On Fri, May 11, 2018 at 02:56:17PM +0200, Michal Privoznik wrote:
There's this macro virBufferSetChildIndent which sets offset of child buffer from given parent buffer. However, it is calling virBufferAdjustIndent() which only adds adjustment instead of calling virBufferSetIndent() which clears out any adjustment previously set.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/util/virbuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Michal Privoznik