[*] AuProcess on linux: use AuParse instead of strtoll

This commit is contained in:
Reece Wilson 2024-08-01 11:41:44 +01:00
parent 2274b7f624
commit c6ce29a188

View File

@ -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);