uni-t-dmm: style nits, copy loop vs memmove

This commit is contained in:
Gerhard Sittig 2018-02-21 18:03:11 +01:00 committed by Uwe Hermann
parent 69229e5c15
commit f7711ed56c
1 changed files with 2 additions and 2 deletions

View File

@ -258,8 +258,8 @@ static int get_and_handle_data(struct sr_dev_inst *sdi)
}
/* Move remaining bytes to beginning of buffer. */
for (i = 0; i < devc->buflen - devc->bufoffset; i++)
pbuf[i] = pbuf[devc->bufoffset + i];
if (devc->bufoffset < devc->buflen)
memmove(pbuf, pbuf + devc->bufoffset, devc->buflen - devc->bufoffset);
devc->buflen -= devc->bufoffset;
return SR_OK;