From 79611c59684b5980e747122baf23d115c03b7e34 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 15 Jan 2013 13:12:59 -0500 Subject: [PATCH] util: Check for negative indent in virBufferAdd Since virBufferGetIndent() will check and fail on buf->error, I removed that check from virBufferAdd() and used the -1 return as the way to exit. --- src/util/virbuffer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index 969dcbf6b9..693e4b2942 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -153,10 +153,9 @@ virBufferAdd(virBufferPtr buf, const char *str, int len) if (!str || !buf || (len == 0 && buf->indent == 0)) return; - if (buf->error) - return; - indent = virBufferGetIndent(buf, true); + if (indent < 0) + return; if (len < 0) len = strlen(str); -- 2.39.5