Skip to content

Commit 7f7c788

Browse files
authored
[unsafe] Replace pointer arithmetic with offset method
1 parent 2a29316 commit 7f7c788

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libcc2rs/src/io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub unsafe fn fwrite_unsafe(
193193
for b in buffer.iter_mut().take(to_fill) {
194194
unsafe {
195195
*b = *src;
196-
src += 1;
196+
src = src.offset(1);
197197
}
198198
}
199199

@@ -252,7 +252,7 @@ pub unsafe fn fread_unsafe(
252252
for &byte in &buffer[..n] {
253253
unsafe {
254254
*dst = byte;
255-
dst += 1;
255+
dst = dst.offset(1);
256256
}
257257
}
258258

0 commit comments

Comments
 (0)