diff --git a/Userland/Services/DHCPClient/main.cpp b/Userland/Services/DHCPClient/main.cpp index 8def7ec954..a70a9fc045 100644 --- a/Userland/Services/DHCPClient/main.cpp +++ b/Userland/Services/DHCPClient/main.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -39,8 +40,9 @@ static u8 mac_part(const Vector& parts, size_t index) { - auto chars = parts.at(index).characters(); - return (chars[0] - '0') * 16 + (chars[1] - '0'); + auto result = AK::StringUtils::convert_to_uint_from_hex(parts.at(index)); + VERIFY(result.has_value()); + return result.value(); } static MACAddress mac_from_string(const String& str)