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

Michal Privoznik posted 1 patch 5 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/17e1b2e5542d40dcd569d120e36c057456ee37bf.1526043377.git.mprivozn@redhat.com
Test syntax-check passed
src/util/virbuffer.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] virbuffer: Set child buffer indent properly
Posted by Michal Privoznik 5 years, 11 months ago
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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virbuffer: Set child buffer indent properly
Posted by Ján Tomko 5 years, 11 months ago
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
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list