mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
utils: Remove ATTRIBUTE_NONNULL(1) from virCommandSetSendBuffer
Remove the ATTRIBUTE_NONNULL(1) from virCommandSetSendBuffer() prototype since we are checking for '!cmd' and move the initialization if 'i' after the test for '!cmd'. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: John Ferlan <jferlan@redhat.com> Message-Id: <20190726205633.2041912-4-stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
9b4bc79549
commit
4f5fff8735
@ -1775,7 +1775,7 @@ virCommandSetSendBuffer(virCommandPtr cmd,
|
||||
int fd,
|
||||
unsigned char *buffer, size_t buflen)
|
||||
{
|
||||
size_t i = virCommandGetNumSendBuffers(cmd);
|
||||
size_t i;
|
||||
|
||||
if (!cmd || cmd->has_error)
|
||||
return -1;
|
||||
@ -1787,6 +1787,7 @@ virCommandSetSendBuffer(virCommandPtr cmd,
|
||||
return -1;
|
||||
}
|
||||
|
||||
i = virCommandGetNumSendBuffers(cmd);
|
||||
if (VIR_REALLOC_N(cmd->sendBuffers, i + 1) < 0) {
|
||||
cmd->has_error = ENOMEM;
|
||||
return -1;
|
||||
|
@ -149,7 +149,7 @@ void virCommandSetWorkingDirectory(virCommandPtr cmd,
|
||||
int virCommandSetSendBuffer(virCommandPtr cmd,
|
||||
int fd,
|
||||
unsigned char *buffer, size_t buflen)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
|
||||
ATTRIBUTE_NONNULL(3);
|
||||
|
||||
void virCommandSetInputBuffer(virCommandPtr cmd,
|
||||
const char *inbuf) ATTRIBUTE_NONNULL(2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user