util: buffer: Remove struct member munging

This was meant to stop abusing the members directly, but we don't do
this for other internal structs. Additionally this did not stop the
test from touching the members. Remove the header obscurization.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa
2019-03-25 16:54:28 +01:00
parent fb59497484
commit 14f7030f95
3 changed files with 7 additions and 23 deletions

View File

@@ -29,7 +29,7 @@ static int testBufInfiniteLoop(const void *data)
* which was the case after the above addchar at the time of the bug.
* This test is a bit fragile, since it relies on virBuffer internals.
*/
if (virAsprintf(&addstr, "%*s", buf->a - buf->b - 1, "a") < 0)
if (virAsprintf(&addstr, "%*s", buf->size - buf->use - 1, "a") < 0)
goto out;
if (info->doEscape)