From fe506fa0fb71c14489516e0e5b5bfb4797b901aa Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Sun, 6 Mar 2016 02:37:36 +0200 Subject: [PATCH] Use sizeof(tx_buf_len) instead of length. * Length should always be 4 but it's safer this way. --- src/omv/usbdbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/omv/usbdbg.c b/src/omv/usbdbg.c index 8d00853f8..f11afbd7b 100644 --- a/src/omv/usbdbg.c +++ b/src/omv/usbdbg.c @@ -77,7 +77,7 @@ void usbdbg_data_in(void *buffer, int length) case USBDBG_TX_BUF_LEN: { uint32_t tx_buf_len = usbd_cdc_tx_buf_len(); - memcpy(buffer, &tx_buf_len, length); + memcpy(buffer, &tx_buf_len, sizeof(tx_buf_len)); cmd = USBDBG_NONE; break; }