uni-t-dmm: style nits, copy loop vs memmove
This commit is contained in:
parent
69229e5c15
commit
f7711ed56c
|
@ -258,8 +258,8 @@ static int get_and_handle_data(struct sr_dev_inst *sdi)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move remaining bytes to beginning of buffer. */
|
/* Move remaining bytes to beginning of buffer. */
|
||||||
for (i = 0; i < devc->buflen - devc->bufoffset; i++)
|
if (devc->bufoffset < devc->buflen)
|
||||||
pbuf[i] = pbuf[devc->bufoffset + i];
|
memmove(pbuf, pbuf + devc->bufoffset, devc->buflen - devc->bufoffset);
|
||||||
devc->buflen -= devc->bufoffset;
|
devc->buflen -= devc->bufoffset;
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
Loading…
Reference in New Issue