Browse Source

Kernel: Use ByteBuffer::zero_fill() instead of raw memset in Ext2

There was a typo in one of the memsets, use the type safe wrapper instead.

Fix EXt
Brian Gianforcaro 4 years ago
parent
commit
7c950c2d01
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Kernel/FileSystem/Ext2FileSystem.cpp

+ 2 - 2
Kernel/FileSystem/Ext2FileSystem.cpp

@@ -343,7 +343,7 @@ KResult Ext2FS::write_block_list_for_inode(InodeIndex inode_index, ext2_inode& e
 
         auto dind_block_contents = ByteBuffer::create_uninitialized(block_size());
         if (dind_block_new) {
-            memset(dind_block_contents.data(), 0, dind_block_contents.size());
+            dind_block_contents.zero_fill();
             dind_block_dirty = true;
         } else {
             auto buffer = UserOrKernelBuffer::for_kernel_buffer(dind_block_contents.data());
@@ -370,7 +370,7 @@ KResult Ext2FS::write_block_list_for_inode(InodeIndex inode_index, ext2_inode& e
 
             auto ind_block_contents = ByteBuffer::create_uninitialized(block_size());
             if (ind_block_new) {
-                memset(ind_block_contents.data(), 0, dind_block_contents.size());
+                ind_block_contents.zero_fill();
                 ind_block_dirty = true;
             } else {
                 auto buffer = UserOrKernelBuffer::for_kernel_buffer(ind_block_contents.data());