1
0
mirror of https://github.com/leethomason/tinyxml2.git synced 2026-07-21 19:23:00 +04:00

Update integer parsing to use long type and unsigned parsing to use unsigned long type for better compatibility with different platforms.

Update integer parsing to use long type and unsigned parsing to use unsigned long type for better compatibility with different platforms. Alternatively, use the PRI Macros there.

alternatively use the PRI Macros there.
This commit is contained in:
Franz Höpfinger
2024-05-30 20:13:48 +02:00
parent a151353f3a
commit afb8fabf58
+2 -2
View File
@@ -618,7 +618,7 @@ bool XMLUtil::ToInt(const char* str, int* value)
}
}
else {
if (TIXML_SSCANF(str, "%d", value) == 1) {
if (TIXML_SSCANF(str, "%ld", value) == 1) {
return true;
}
}
@@ -627,7 +627,7 @@ bool XMLUtil::ToInt(const char* str, int* value)
bool XMLUtil::ToUnsigned(const char* str, unsigned* value)
{
if (TIXML_SSCANF(str, IsPrefixHex(str) ? "%x" : "%u", value) == 1) {
if (TIXML_SSCANF(str, IsPrefixHex(str) ? "%x" : "%lu", value) == 1) {
return true;
}
return false;