#9 Copying similar to C version

Opened by darleybarreto on Oct 9, 2021, 1:52 PM
// darleybarreto on Oct 9, 2021, 1:52 PM

I’ll add a patch for this.

Original C

memcpy((BYTE*)output->dst + output->pos,
               tmp + (fl->seekTablePos - offset), lenWrite);

Current Rust

output[*pos..*pos + len_write].copy_from_slice(&bytes[..len_write]);

Possibly right version

let start_write = (self.seek_table_pos - offset) as usize;
output[*pos..*pos + len_write].copy_from_slice(&bytes[start_write .. start_write + len_write]);
darleybarreto
~ darleybarreto pushed a change on Oct 9, 2021, 1:56 PM
· darleybarreto · on Oct 9, 2021, 1:55 PM
WCOOB6VVCGVVS6UPWYBS36ALHRJ77D5CWPBMK2XC2NM4SOMQW7SQC