mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
util: remove unnecessary needSize
Use toadd->use directly. Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
This commit is contained in:
parent
d3fa510a75
commit
e340013ea8
@ -186,8 +186,6 @@ virBufferAdd(virBufferPtr buf, const char *str, int len)
|
||||
void
|
||||
virBufferAddBuffer(virBufferPtr buf, virBufferPtr toadd)
|
||||
{
|
||||
unsigned int needSize;
|
||||
|
||||
if (!toadd)
|
||||
return;
|
||||
|
||||
@ -200,8 +198,7 @@ virBufferAddBuffer(virBufferPtr buf, virBufferPtr toadd)
|
||||
goto done;
|
||||
}
|
||||
|
||||
needSize = buf->use + toadd->use;
|
||||
if (virBufferGrow(buf, needSize - buf->use) < 0)
|
||||
if (virBufferGrow(buf, toadd->use) < 0)
|
||||
goto done;
|
||||
|
||||
memcpy(&buf->content[buf->use], toadd->content, toadd->use);
|
||||
|
Loading…
x
Reference in New Issue
Block a user