mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-21 02:01:03 +00:00
Fix idStr self-assignment
Was calling memcpy with overlapping parameters which is inefficient, undefined behavior and Valgrind complained about it.
This commit is contained in:
parent
f26f70c717
commit
5da6374663
1 changed files with 4 additions and 0 deletions
|
@ -519,6 +519,10 @@ ID_INLINE char &idStr::operator[]( int index ) {
|
|||
#pragma GCC diagnostic pop
|
||||
|
||||
ID_INLINE void idStr::operator=( const idStr &text ) {
|
||||
if (&text == this) {
|
||||
return;
|
||||
}
|
||||
|
||||
int l;
|
||||
|
||||
l = text.Length();
|
||||
|
|
Loading…
Reference in a new issue