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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2018-05-11 14:05:53 +02:00
parent b3f75d9980
commit ebad530e9f

View 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);