Fix off-by-1 in WMArray iteration #26
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
@@ -359,7 +359,7 @@ pub mod ffi {
|
||||
if index < 0 {
|
||||
return ptr::null_mut();
|
||||
}
|
||||
match array.items.get(index as usize) {
|
||||
match array.items.get(index as usize + 1) {
|
||||
Some(i) => {
|
||||
unsafe {
|
||||
*iter += 1;
|
||||
@@ -382,10 +382,10 @@ pub mod ffi {
|
||||
}
|
||||
let array = unsafe { &*array };
|
||||
let index = unsafe { *iter };
|
||||
if index < 0 {
|
||||
if index < 1 {
|
||||
return ptr::null_mut();
|
||||
}
|
||||
match array.items.get(index as usize) {
|
||||
match array.items.get(index as usize - 1) {
|
||||
Some(i) => {
|
||||
unsafe {
|
||||
*iter -= 1;
|
||||
|
||||
Reference in New Issue
Block a user