inputs-channel-client: Use sizeof instead of size constant

Minimal style change.
Allows to easier change the size of the buffer.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
This commit is contained in:
Frediano Ziglio 2020-03-04 07:33:11 +00:00
parent 1bf9d22cf2
commit 7230ff3d47

View File

@ -43,13 +43,14 @@ static uint8_t *
inputs_channel_client_alloc_msg_rcv_buf(RedChannelClient *rcc,
uint16_t type, uint32_t size)
{
if (size > RECEIVE_BUF_SIZE) {
InputsChannelClient *icc = INPUTS_CHANNEL_CLIENT(rcc);
if (size > sizeof(icc->priv->recv_buf)) {
red_channel_warning(red_channel_client_get_channel(rcc),
"error: too large incoming message");
return NULL;
}
InputsChannelClient *icc = INPUTS_CHANNEL_CLIENT(rcc);
return icc->priv->recv_buf;
}