samples: cdc_acm_composite: Use proper type for variable 'read'
Function uart_fifo_read() returns 'int' (it may return negative values in error cases). Its return value is stored in the variable 'read' that is, however, of type 'size_t'. Change the type of the variable 'read' from 'size_t' to 'int' to accomodate proper handling of uart_fifo_read() invocation. Coverity-CID: 248408 Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
This commit is contained in:
parent
54cd46ac68
commit
9760c83267
|
@ -50,7 +50,8 @@ static void interrupt_handler(const struct device *dev, void *user_data)
|
|||
|
||||
if (uart_irq_rx_ready(dev)) {
|
||||
uint8_t buf[64];
|
||||
size_t read, wrote;
|
||||
int read;
|
||||
size_t wrote;
|
||||
struct ring_buf *rb = &peer->data->rb;
|
||||
|
||||
read = uart_fifo_read(dev, buf, sizeof(buf));
|
||||
|
|
Loading…
Reference in a new issue