diff --git a/Source/Process/AuProcessMap.Linux.cpp b/Source/Process/AuProcessMap.Linux.cpp index b1f2a953..eb2d2848 100644 --- a/Source/Process/AuProcessMap.Linux.cpp +++ b/Source/Process/AuProcessMap.Linux.cpp @@ -89,23 +89,27 @@ namespace Aurora::Process AuParse::SplitNewlines(map, [&](const AuROString &line) { bool bIsSpecialFile {}; - char *endPtr; - auto base = strtoll(line.data(), &endPtr, 16); - if (errno == ERANGE) return; + const char *endPtr = line.data() + line.size(); + const char *endPtr2 = line.data() + line.size(); + const char *endPtr3 = line.data() + line.size(); + auto optBase = AuParse::ParseUInt16(line.data(), endPtr); + if (!optBase) return; + auto base = optBase.value(); if (*endPtr != '-') return; - auto end = strtoll(endPtr + 1, &endPtr, 16); - if (errno == ERANGE) return; - if (*endPtr != ' ') return; + auto optEnd = AuParse::ParseUInt16(endPtr + 1, endPtr2); + if (!optEnd) return; + auto end = optEnd.value(); + if (*endPtr2 != ' ') return; - auto perms = endPtr + 1; + auto perms = endPtr2 + 1; auto A = line.find_first_of(':'); if (A == AuString::npos) return; auto offsetStart = perms + 5; - auto uFileOffset = strtoll(offsetStart, &endPtr, 16); - if (errno == ERANGE) uFileOffset = 0; + auto optuFileOffset = AuParse::ParseUInt16(offsetStart, endPtr3); + AuUInt uFileOffset = optuFileOffset ? optuFileOffset.value() : 0u; A += 4; auto gross = line.substr(A);