projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e3e4fb
)
Fix cast from const by accessing string data directly (#8354)
author
rubenwardy
<rw@rubenwardy.com>
Tue, 12 Mar 2019 07:58:02 +0000
(07:58 +0000)
committer
Loïc Blot
<nerzhul@users.noreply.github.com>
Tue, 12 Mar 2019 07:58:02 +0000
(08:58 +0100)
Fixes #8327
src/irrlicht_changes/irrUString.h
patch
|
blob
|
history
diff --git
a/src/irrlicht_changes/irrUString.h
b/src/irrlicht_changes/irrUString.h
index fce49e7177d3397c1c47dbaaeb65e54a3cb05bbb..b628c092c28b5a2371d65910ec81f126a498626a 100644
(file)
--- 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];
}