diff --git a/game/bag.cpp b/game/bag.cpp index 215d571..a867c54 100644 --- a/game/bag.cpp +++ b/game/bag.cpp @@ -142,10 +142,11 @@ Tile Bag::selectRandomTile(unsigned int total, } -void Bag::operator=(const Bag &iOther) +Bag & Bag::operator=(const Bag &iOther) { m_tilesMap = iOther.m_tilesMap; m_ntiles = iOther.m_ntiles; + return *this; } diff --git a/game/bag.h b/game/bag.h index d6dcab1..81ab584 100644 --- a/game/bag.h +++ b/game/bag.h @@ -75,7 +75,7 @@ public: */ Tile selectRandomConsonant() const; - void operator=(const Bag &iOther); + Bag & operator=(const Bag &iOther); /// Convenience getter on the dictionary const Dictionary & getDic() const { return m_dic; } diff --git a/utils/eliottxt.cpp b/utils/eliottxt.cpp index c0cf1b6..59f8236 100644 --- a/utils/eliottxt.cpp +++ b/utils/eliottxt.cpp @@ -102,10 +102,7 @@ wchar_t *rl_gets() wline_read = new wchar_t[len + 1]; mbstowcs(wline_read, line_read, len + 1); - if (line_read) - { - free(line_read); - } + free(line_read); #else if (!cin.good()) return NULL;