mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
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:
parent
e69a85cc2b
commit
79611c5968
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user