mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +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))
|
if (!str || !buf || (len == 0 && buf->indent == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (buf->error)
|
|
||||||
return;
|
|
||||||
|
|
||||||
indent = virBufferGetIndent(buf, true);
|
indent = virBufferGetIndent(buf, true);
|
||||||
|
if (indent < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
len = strlen(str);
|
len = strlen(str);
|
||||||
|
Loading…
Reference in New Issue
Block a user