Remove() was moving an additional array element. Mostly harmless, but
would cause a crash when the array end was page-aligned and the next page was not accessible. Happened to me during a "rm -rf ...". git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26320 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
1bde8b03e7
commit
65748dc8d9
@ -60,8 +60,8 @@ sorted_array::Remove(off_t value)
|
||||
if (index == -1)
|
||||
return false;
|
||||
|
||||
memmove(&values[index], &values[index + 1], (count - index) * sizeof(off_t));
|
||||
count--;
|
||||
memmove(&values[index], &values[index + 1], (count - index) * sizeof(off_t));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user