From afb8fabf58aac429452aecf9c7dc7051deadfcfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:13:48 +0200 Subject: [PATCH] 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. --- tinyxml2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index ad4b655..ce0c9fa 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -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;