File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -91,17 +91,17 @@ inline void TCellChar::moveInt(uint32_t mbc, bool wide)
91
91
inline void TCellChar::moveStr (TStringView mbc, bool wide)
92
92
{
93
93
static_assert (sizeof (_text) >= 4 , " " );
94
- if (mbc.size () <= 4 )
94
+ memset (this , 0 , sizeof (*this ));
95
+ if (0 < mbc.size () && mbc.size () <= 4 )
95
96
{
96
- memset ( this , 0 , sizeof (* this )) ;
97
+ _flags |= - int (wide) & fWide ;
97
98
switch (mbc.size ())
98
99
{
99
100
case 4 : _text[3 ] = mbc[3 ];
100
101
case 3 : _text[2 ] = mbc[2 ];
101
102
case 2 : _text[1 ] = mbc[1 ];
102
103
case 1 : _text[0 ] = mbc[0 ];
103
104
}
104
- _flags |= -int (wide) & fWide ;
105
105
}
106
106
}
107
107
@@ -127,7 +127,7 @@ constexpr inline void TCellChar::appendZeroWidth(TStringView mbc)
127
127
size_t sz = size ();
128
128
if (mbc.size () <= sizeof (_text) - sz)
129
129
{
130
- if (!mbc [0 ])
130
+ if (_text [0 ] == ' \0 ' )
131
131
_text[0 ] = ' ' ;
132
132
switch (mbc.size ())
133
133
{
You can’t perform that action at this time.
0 commit comments