提交 4f5fff87 编写于 作者: S Stefan Berger 提交者: Eric Blake

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: NStefan Berger <stefanb@linux.ibm.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
Message-Id: <20190726205633.2041912-4-stefanb@linux.vnet.ibm.com>
上级 9b4bc795
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册