Skip to content

Commit 687066f

Browse files
committed
sentence: Use for range loop and safe str APIs to cleanup
1 parent dae51c5 commit 687066f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

public/sentence.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,16 +1345,18 @@ void CSentence::SetTextFromWords( void )
13451345
#if PHONEME_EDITOR
13461346
char fulltext[ 1024 ];
13471347
fulltext[ 0 ] = '\0';
1348-
for ( intp i = 0 ; i < m_Words.Count(); i++ )
1349-
{
1350-
CWordTag *word = m_Words[ i ];
13511348

1352-
Q_strncat( fulltext, word->GetWord(), sizeof( fulltext ), COPY_ALL_CHARACTERS );
1349+
intp i = 0;
1350+
for ( auto *word : m_Words )
1351+
{
1352+
V_strcat_safe( fulltext, word->GetWord() );
13531353

13541354
if ( i != m_Words.Count() )
13551355
{
1356-
Q_strncat( fulltext, " ", sizeof( fulltext ), COPY_ALL_CHARACTERS );
1356+
V_strcat_safe( fulltext, " " );
13571357
}
1358+
1359+
++i;
13581360
}
13591361

13601362
SetText( fulltext );

0 commit comments

Comments
 (0)