summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibUSBDB
diff options
context:
space:
mode:
authorJesse Buhagiar <jooster669@gmail.com>2021-06-18 23:18:22 +1000
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-18 19:41:25 +0430
commit906d3e9f44dee00d2cbc27577dc7f836b464ab72 (patch)
tree40103f94ea43b2f8f056c999a1d72b6f99421a05 /Userland/Libraries/LibUSBDB
parent94f56b5f6dcb194723cb532c6613526b6b321312 (diff)
downloadserenity-906d3e9f44dee00d2cbc27577dc7f836b464ab72.zip
LibUSBDB: Fix vendor id decoding
This was broken because the whole line was being passed in instead of a substring..
Diffstat (limited to 'Userland/Libraries/LibUSBDB')
-rw-r--r--Userland/Libraries/LibUSBDB/Database.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibUSBDB/Database.cpp b/Userland/Libraries/LibUSBDB/Database.cpp
index 952423a144..e42a0fa03f 100644
--- a/Userland/Libraries/LibUSBDB/Database.cpp
+++ b/Userland/Libraries/LibUSBDB/Database.cpp
@@ -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>();