mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibUSBDB: Fix vendor id decoding
This was broken because the whole line was being passed in instead of a substring..
This commit is contained in:
parent
94f56b5f6d
commit
906d3e9f44
Notes:
sideshowbarker
2024-07-18 12:05:14 +09:00
Author: https://github.com/Quaker762 Commit: https://github.com/SerenityOS/serenity/commit/906d3e9f44d Pull-request: https://github.com/SerenityOS/serenity/pull/8136
1 changed files with 2 additions and 2 deletions
|
@ -161,12 +161,12 @@ int Database::init()
|
|||
if (line[0] != '\t') {
|
||||
commit_vendor();
|
||||
current_vendor = make<Vendor>();
|
||||
current_vendor->id = AK::StringUtils::convert_to_uint_from_hex<u16>(line).value_or(0);
|
||||
current_vendor->id = AK::StringUtils::convert_to_uint_from_hex<u16>(line.substring_view(0, 4)).value_or(0);
|
||||
current_vendor->name = line.substring_view(6, line.length() - 6);
|
||||
} else if (line[0] == '\t' && line[1] != '\t') {
|
||||
commit_device();
|
||||
current_device = make<Device>();
|
||||
current_device->id = AK::StringUtils::convert_to_uint_from_hex<u16>((line.substring_view(1, line.length() - 1))).value_or(0);
|
||||
current_device->id = AK::StringUtils::convert_to_uint_from_hex<u16>((line.substring_view(1, 4))).value_or(0);
|
||||
current_device->name = line.substring_view(7, line.length() - 7);
|
||||
} else if (line[0] == '\t' && line[1] == '\t') {
|
||||
auto interface = make<Interface>();
|
||||
|
|
Loading…
Reference in a new issue