aboutsummaryrefslogtreecommitdiff
path: root/src/irrlicht_changes/irrUString.h
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-03-12 07:58:02 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2019-03-12 08:58:02 +0100
commit38f6e7a1981a8dcba9bfa9aa32ca77cd19a960aa (patch)
tree07a2658f9fb46a1fff47b0412c6b39c0f3976437 /src/irrlicht_changes/irrUString.h
parent1e3e4fb6492832048b484ffe784613a16713f1d2 (diff)
downloadminetest-38f6e7a1981a8dcba9bfa9aa32ca77cd19a960aa.tar.gz
minetest-38f6e7a1981a8dcba9bfa9aa32ca77cd19a960aa.tar.bz2
minetest-38f6e7a1981a8dcba9bfa9aa32ca77cd19a960aa.zip
Fix cast from const by accessing string data directly (#8354)
Fixes #8327
Diffstat (limited to 'src/irrlicht_changes/irrUString.h')
-rw-r--r--src/irrlicht_changes/irrUString.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/irrlicht_changes/irrUString.h b/src/irrlicht_changes/irrUString.h
index fce49e717..b628c092c 100644
--- a/src/irrlicht_changes/irrUString.h
+++ b/src/irrlicht_changes/irrUString.h
@@ -2916,13 +2916,13 @@ public:
ret[0] = unicode::BOM;
else if (endian == unicode::EUTFEE_LITTLE)
{
- uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(ret.c_str());
+ uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(&ret[0]);
*ptr8++ = unicode::BOM_ENCODE_UTF16_LE[0];
*ptr8 = unicode::BOM_ENCODE_UTF16_LE[1];
}
else
{
- uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(ret.c_str());
+ uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(&ret[0]);
*ptr8++ = unicode::BOM_ENCODE_UTF16_BE[0];
*ptr8 = unicode::BOM_ENCODE_UTF16_BE[1];
}