summaryrefslogtreecommitdiffstats
path: root/Source/cmXMLSafe.cxx
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-10-21 16:35:57 (GMT)
committerSean McBride <sean@rogue-research.com>2021-10-25 22:23:13 (GMT)
commit5ba6e8ac59333aa574d5963332e3ef0f4c4d3514 (patch)
treed796f695e10d5ec20508cb04f4c8b3c2a6c0d742 /Source/cmXMLSafe.cxx
parent0ce50dd78f68b697e1ab29d52d733b87c5bfb67d (diff)
downloadCMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.zip
CMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.tar.gz
CMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.tar.bz2
Source: Replace most calls to sprintf with snprintf
Diffstat (limited to 'Source/cmXMLSafe.cxx')
-rw-r--r--Source/cmXMLSafe.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmXMLSafe.cxx b/Source/cmXMLSafe.cxx
index d31a239..4014635 100644
--- a/Source/cmXMLSafe.cxx
+++ b/Source/cmXMLSafe.cxx
@@ -73,7 +73,7 @@ std::ostream& operator<<(std::ostream& os, cmXMLSafe const& self)
} else {
// Use a human-readable hex value for this invalid character.
char buf[16];
- sprintf(buf, "%X", ch);
+ snprintf(buf, sizeof(buf), "%X", ch);
os << "[NON-XML-CHAR-0x" << buf << "]";
}
@@ -82,7 +82,7 @@ std::ostream& operator<<(std::ostream& os, cmXMLSafe const& self)
ch = static_cast<unsigned char>(*first++);
// Use a human-readable hex value for this invalid byte.
char buf[16];
- sprintf(buf, "%X", ch);
+ snprintf(buf, sizeof(buf), "%X", ch);
os << "[NON-UTF-8-BYTE-0x" << buf << "]";
}
}