Use `char *` for pointer arithmetic

PR #4374 <https://github.com/Genymobile/scrcpy/pull/4374>

Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
Avinash Sonawane 2023-10-16 09:29:41 +05:30 committed by Romain Vimont
parent 3c2013de10
commit bc8913e12b
1 changed files with 2 additions and 2 deletions

View File

@ -190,10 +190,10 @@ sc_vecdeque_reallocdata_(void *ptr, size_t newcap, size_t item_size,
size_t right_len = MIN(size, oldcap - oldorigin);
assert(right_len);
memcpy(newptr, ptr + (oldorigin * item_size), right_len * item_size);
memcpy(newptr, (char *) ptr + (oldorigin * item_size), right_len * item_size);
if (size > right_len) {
memcpy(newptr + (right_len * item_size), ptr,
memcpy((char *) newptr + (right_len * item_size), ptr,
(size - right_len) * item_size);
}