diff --git a/libr/util/mem.c b/libr/util/mem.c index d78c3161eb..d7005e1cb0 100644 --- a/libr/util/mem.c +++ b/libr/util/mem.c @@ -143,8 +143,8 @@ R_API void r_mem_copybits_delta(ut8 *dst, int doff, const ut8 *src, int soff, in eprintf ("SHIT SHIT SHIT!\n"); } for (int i = 0; i < bits; ++i) { - ut8 c = readbit (src, bits + soff); - writebit (dst, bits + soff, c); + ut8 c = readbit (src, i + soff); + writebit (dst, i + soff, c); } }