mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcXmlLib: Fix parsing negative integers
Resolves issues with parsing MinVersion/MinDate in APFS section
This commit is contained in:
parent
02d3d698f5
commit
c8a50907b0
@ -1530,16 +1530,37 @@ PlistIntegerValue (
|
||||
BOOLEAN Hex
|
||||
)
|
||||
{
|
||||
UINT64 Temp;
|
||||
UINT64 Temp;
|
||||
CONST CHAR8 *TempStr;
|
||||
BOOLEAN Negate;
|
||||
|
||||
if (PlistNodeCast (Node, PLIST_NODE_TYPE_INTEGER) == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TempStr = XmlNodeContent (Node);
|
||||
|
||||
while (*TempStr == ' ' || *TempStr == '\t') {
|
||||
++TempStr;
|
||||
}
|
||||
|
||||
Negate = *TempStr == '-';
|
||||
|
||||
if (Negate) {
|
||||
++TempStr;
|
||||
}
|
||||
|
||||
if (Hex) {
|
||||
Temp = AsciiStrHexToUint64 (XmlNodeContent (Node));
|
||||
Temp = AsciiStrHexToUint64 (TempStr);
|
||||
} else {
|
||||
Temp = AsciiStrDecimalToUint64 (XmlNodeContent (Node));
|
||||
Temp = AsciiStrDecimalToUint64 (TempStr);
|
||||
}
|
||||
|
||||
//
|
||||
// May produce unexpected results when the value is too large, but just do not care.
|
||||
//
|
||||
if (Negate) {
|
||||
Temp = 0ULL - Temp;
|
||||
}
|
||||
|
||||
switch (Size) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user