Skip to content

Commit

Permalink
Fix initializing screen cell text in big endian systems
Browse files Browse the repository at this point in the history
Regressed by 5a9d715.
  • Loading branch information
magiblot committed Oct 15, 2024
1 parent c757578 commit bef194f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/tvision/scrncell.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,15 @@ inline void TCellChar::moveMultiByteChar(uint32_t mbc, bool wide)
memset(this, 0, sizeof(*this));
memcpy(_text, &mbc, sizeof(mbc));
_flags = -int(wide) & fWide;
#ifndef TV_BIG_ENDIAN
_textLength = 1 + ((mbc & 0xFF00) != 0) +
((mbc & 0xFF0000) != 0) +
((mbc & 0xFF000000) != 0);
#else
_textLength = 1 + ((mbc & 0xFF0000) != 0) +
((mbc & 0xFF00) != 0) +
((mbc & 0xFF) != 0);
#endif
}

inline void TCellChar::moveMultiByteChar(TStringView mbc, bool wide)
Expand Down

0 comments on commit bef194f

Please sign in to comment.