]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: buffer: Simplify handling of indent overflows
authorPeter Krempa <pkrempa@redhat.com>
Thu, 24 Oct 2019 07:25:20 +0000 (09:25 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 24 Oct 2019 17:35:34 +0000 (19:35 +0200)
commite154e01eadb7a95ffb397deeb4010553a0a6424d
treeca120d457893eaa7d791823bf6effe6e3b4b1c37
parent49037f94d294fbf49646f6edcabb2e1a767fd20b
util: buffer: Simplify handling of indent overflows

Rather than setting usage error truncate the indentation level. Having
the output string misformated is way more useful to figure out where the
error lies rather than reporting an error after a giant formatter
function.

In testBufAutoIndent we now validate that the indentation is truncated
and testBufAddBuffer2 is removed since it became bogus.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virbuffer.c
tests/virbuftest.c