summaryrefslogtreecommitdiffstats
path: root/Source/cmXMLSafe.cxx
diff options
context:
space:
mode:
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 << "]";
}
}