aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-03-12 07:58:02 +0000
committerrubenwardy <rw@rubenwardy.com>2019-03-12 20:25:55 +0000
commitdd451a8a0055ad082d3fbc4af34c401f22bfb7d6 (patch)
tree359f7fe3ab9c00323dc7d89dc6b4e1c71824431c
parent444ec1e4128e68523f1bbf51aa03e8bf2006156c (diff)
downloadminetest-dd451a8a0055ad082d3fbc4af34c401f22bfb7d6.tar.gz
minetest-dd451a8a0055ad082d3fbc4af34c401f22bfb7d6.tar.bz2
minetest-dd451a8a0055ad082d3fbc4af34c401f22bfb7d6.zip
Fix cast from const by accessing string data directly (#8354)
Fixes #8327
-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];
}