Skip to content

Commit

Permalink
FIX: init string with zero must by outside the loop
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@11469 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
prissi committed Dec 15, 2024
1 parent 1f259b9 commit 34af805
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/simutrans/gui/message_option.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ message_option_t::message_option_t() :
const unsigned char *p = (const unsigned char *)translator::translate( "MessageOptionsText" );
welt->get_message()->get_message_flags( &ticker_msg, &window_msg, &auto_msg, &ignore_msg );

for( int i = 0; i < message_t::MAX_MESSAGE_TYPE; i++ ) {
option_texts[i][0] = 0;
}
for( int i=0; i<message_t::MAX_MESSAGE_TYPE; i++ ) {

buttons[i*4].set_typ(button_t::square_state);
Expand All @@ -47,9 +50,6 @@ message_option_t::message_option_t() :
while( *p < ' ' && *p ) {
p++;
}
for (int i = 0; i < message_t::MAX_MESSAGE_TYPE; i++) {
option_texts[i][0] = 0;
}
for( int j=0; *p>=' '; p++ ) {
if( j < MAX_MESSAGE_OPTION_TEXTLEN-1 ) {
option_texts[i][j++] = *p;
Expand Down

0 comments on commit 34af805

Please sign in to comment.