Fixed a harmless "Source and destination overlap in memcpy"

Fixed a harmess overlap in memcpy() in queue_zero() when the queue
itself is empty. If the queue is empty memcpy can be skipped.
pull/4062/head
René Cannaò 3 years ago
parent 24ddbb8b4a
commit 16f952abb8

@ -118,7 +118,9 @@ static void __dump_pkt(const char *func, unsigned char *_ptr, unsigned int len)
}
#define queue_zero(_q) { \
memcpy(_q.buffer, (unsigned char *)_q.buffer + _q.tail, _q.head - _q.tail); \
if (_q.tail != 0) { \
memcpy(_q.buffer, (unsigned char *)_q.buffer + _q.tail, _q.head - _q.tail); \
} \
_q.head-=_q.tail; \
_q.tail=0; \
}

Loading…
Cancel
Save