Use sizeof(tx_buf_len) instead of length.

* Length should always be 4 but it's safer this way.
This commit is contained in:
iabdalkader 2016-03-06 02:37:36 +02:00
parent c12473d8b7
commit fe506fa0fb

View File

@ -77,7 +77,7 @@ void usbdbg_data_in(void *buffer, int length)
case USBDBG_TX_BUF_LEN: { case USBDBG_TX_BUF_LEN: {
uint32_t tx_buf_len = usbd_cdc_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; cmd = USBDBG_NONE;
break; break;
} }