mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-02 04:20:28 +00:00
Kernel: Fix incorrect argument when constructing DiskPartitionMetadata
The existing code invokes operator bool for the partition_type variable.
This commit is contained in:
parent
24376e7759
commit
4b5dbc15df
Notes:
sideshowbarker
2024-07-18 18:01:50 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/4b5dbc15df9 Pull-request: https://github.com/SerenityOS/serenity/pull/7151 Reviewed-by: https://github.com/alimpfard
2 changed files with 3 additions and 9 deletions
|
@ -64,9 +64,7 @@ EBRPartitionTable::EBRPartitionTable(const StorageDevice& device)
|
|||
if (entry.offset == 0x00) {
|
||||
continue;
|
||||
}
|
||||
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
|
||||
partition_type.data()[0] = entry.type;
|
||||
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
|
||||
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,9 +60,7 @@ MBRPartitionTable::MBRPartitionTable(const StorageDevice& device, u32 start_lba)
|
|||
if (entry.offset == 0x00) {
|
||||
continue;
|
||||
}
|
||||
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
|
||||
partition_type.data()[0] = entry.type;
|
||||
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
|
||||
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
|
||||
}
|
||||
m_valid = true;
|
||||
}
|
||||
|
@ -81,9 +79,7 @@ MBRPartitionTable::MBRPartitionTable(const StorageDevice& device)
|
|||
if (entry.offset == 0x00) {
|
||||
continue;
|
||||
}
|
||||
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
|
||||
partition_type.data()[0] = entry.type;
|
||||
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
|
||||
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
|
||||
}
|
||||
m_valid = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue