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

Michal Privoznik mprivozn at redhat.com
Fri May 11 12:56:17 UTC 2018


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 at 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




More information about the libvir-list mailing list