mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-09 05:51:00 +00:00
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:
parent
1bf9d22cf2
commit
7230ff3d47
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user