From: rubenwardy Date: Tue, 12 Mar 2019 07:58:02 +0000 (+0000) Subject: Fix cast from const by accessing string data directly (#8354) X-Git-Tag: 5.0.1~7 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=dd451a8a0055ad082d3fbc4af34c401f22bfb7d6;p=oweals%2Fminetest.git Fix cast from const by accessing string data directly (#8354) Fixes #8327 --- 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(ret.c_str()); + uchar8_t* ptr8 = reinterpret_cast(&ret[0]); *ptr8++ = unicode::BOM_ENCODE_UTF16_LE[0]; *ptr8 = unicode::BOM_ENCODE_UTF16_LE[1]; } else { - uchar8_t* ptr8 = reinterpret_cast(ret.c_str()); + uchar8_t* ptr8 = reinterpret_cast(&ret[0]); *ptr8++ = unicode::BOM_ENCODE_UTF16_BE[0]; *ptr8 = unicode::BOM_ENCODE_UTF16_BE[1]; }