Skip to content

Commit

Permalink
Fix cast from const by accessing string data directly (#8354)
Browse files Browse the repository at this point in the history
Fixes #8327
  • Loading branch information
rubenwardy authored and nerzhul committed Mar 12, 2019
1 parent 1e3e4fb commit 38f6e7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/irrlicht_changes/irrUString.h
Expand Up @@ -2916,13 +2916,13 @@ class ustring16
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];
}
Expand Down

0 comments on commit 38f6e7a

Please sign in to comment.