Skip to content

Commit

Permalink
Merge pull request #976 from leethomason/AlbertHungGarmin-format_error
Browse files Browse the repository at this point in the history
Albert hung garmin format error
  • Loading branch information
leethomason authored Apr 21, 2024
2 parents 0f9c021 + c33aae0 commit 312a809
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tinyxml2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2504,7 +2504,7 @@ void XMLDocument::ClearError() {

void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... )
{
TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT );
TIXMLASSERT(error >= 0 && error < XML_ERROR_COUNT);
_errorID = error;
_errorLineNum = lineNum;
_errorStr.Reset();
Expand All @@ -2513,7 +2513,8 @@ void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ...
char* buffer = new char[BUFFER_SIZE];

TIXMLASSERT(sizeof(error) <= sizeof(int));
TIXML_SNPRINTF(buffer, BUFFER_SIZE, "Error=%s ErrorID=%d (0x%x) Line number=%d", ErrorIDToName(error), int(error), int(error), lineNum);
TIXML_SNPRINTF(buffer, BUFFER_SIZE, "Error=%s ErrorID=%d (0x%x) Line number=%d",
ErrorIDToName(error), static_cast<int>(error), static_cast<unsigned int>(error), lineNum);

if (format) {
size_t len = strlen(buffer);
Expand Down

0 comments on commit 312a809

Please sign in to comment.