]> xenbits.xensource.com Git - libvirt.git/commitdiff
virbuffer: Set child buffer indent properly
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 11 May 2018 12:05:53 +0000 (14:05 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 11 May 2018 15:04:12 +0000 (17:04 +0200)
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virbuffer.h

index 4f5ed162fb083d23dc7aa8cd23463a00ff5488ad..e95ee878a17546c9c3779b1b6aec3becaeeffe09 100644 (file)
@@ -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);