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.
This commit is contained in:
John Ferlan 2013-01-15 13:12:59 -05:00 committed by Martin Kletzander
parent e69a85cc2b
commit 79611c5968

View File

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