Fix bug
This commit is contained in:
parent
36e4b12934
commit
b9893813f2
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@ impl TArray {
|
||||||
pub fn clear(&mut self, len: u32) -> Self {
|
pub fn clear(&mut self, len: u32) -> Self {
|
||||||
if self.data_ptr != 0 && self.len > 0 {
|
if self.data_ptr != 0 && self.len > 0 {
|
||||||
let data = unsafe {
|
let data = unsafe {
|
||||||
std::slice::from_raw_parts_mut(self.data_ptr as *mut u8, self.len)
|
std::slice::from_raw_parts_mut(self.data_ptr as *mut u8, self.len as usize)
|
||||||
};
|
};
|
||||||
data.fill(0);
|
data.fill(0);
|
||||||
self.len = 0;
|
self.len = 0;
|
||||||
|
|
Loading…
Reference in a new issue