mirror of https://github.com/Genymobile/scrcpy
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:
parent
3c2013de10
commit
bc8913e12b
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue