From: John Ferlan Date: Tue, 15 Jan 2013 18:12:59 +0000 (-0500) Subject: util: Check for negative indent in virBufferAdd X-Git-Tag: v1.0.2-rc1~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79611c59684b5980e747122baf23d115c03b7e34;p=thirdparty%2Flibvirt.git 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. --- 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);