diff options
Diffstat (limited to 'c/data.cpp')
-rw-r--r-- | c/data.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -72,8 +72,8 @@ template <size_t N> bool WcharsFromXmlchars(wchar_t (&dst)[N], XmlCharPtr utf8) { /* Truncate if source is larger than destination. */ - utf8[N] = 0; int lenUtf8 = xmlStrlen(utf8); + utf8[std::min(N, static_cast<size_t>(lenUtf8))] = 0; /* Convert internal representation from UTF-8 to Latin-1, * which seems to actually convert the string to proper UTF-8 |