[*] AuProcess on linux: use AuParse instead of strtoll
This commit is contained in:
parent
2274b7f624
commit
c6ce29a188
@ -89,23 +89,27 @@ namespace Aurora::Process
|
|||||||
AuParse::SplitNewlines(map, [&](const AuROString &line)
|
AuParse::SplitNewlines(map, [&](const AuROString &line)
|
||||||
{
|
{
|
||||||
bool bIsSpecialFile {};
|
bool bIsSpecialFile {};
|
||||||
char *endPtr;
|
const char *endPtr = line.data() + line.size();
|
||||||
auto base = strtoll(line.data(), &endPtr, 16);
|
const char *endPtr2 = line.data() + line.size();
|
||||||
if (errno == ERANGE) return;
|
const char *endPtr3 = line.data() + line.size();
|
||||||
|
auto optBase = AuParse::ParseUInt16(line.data(), endPtr);
|
||||||
|
if (!optBase) return;
|
||||||
|
auto base = optBase.value();
|
||||||
if (*endPtr != '-') return;
|
if (*endPtr != '-') return;
|
||||||
|
|
||||||
auto end = strtoll(endPtr + 1, &endPtr, 16);
|
auto optEnd = AuParse::ParseUInt16(endPtr + 1, endPtr2);
|
||||||
if (errno == ERANGE) return;
|
if (!optEnd) return;
|
||||||
if (*endPtr != ' ') return;
|
auto end = optEnd.value();
|
||||||
|
if (*endPtr2 != ' ') return;
|
||||||
|
|
||||||
auto perms = endPtr + 1;
|
auto perms = endPtr2 + 1;
|
||||||
|
|
||||||
auto A = line.find_first_of(':');
|
auto A = line.find_first_of(':');
|
||||||
if (A == AuString::npos) return;
|
if (A == AuString::npos) return;
|
||||||
|
|
||||||
auto offsetStart = perms + 5;
|
auto offsetStart = perms + 5;
|
||||||
auto uFileOffset = strtoll(offsetStart, &endPtr, 16);
|
auto optuFileOffset = AuParse::ParseUInt16(offsetStart, endPtr3);
|
||||||
if (errno == ERANGE) uFileOffset = 0;
|
AuUInt uFileOffset = optuFileOffset ? optuFileOffset.value() : 0u;
|
||||||
|
|
||||||
A += 4;
|
A += 4;
|
||||||
auto gross = line.substr(A);
|
auto gross = line.substr(A);
|
||||||
|
Loading…
Reference in New Issue
Block a user