Skip to content

Commit

Permalink
squelch warnings
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@8997 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
Dwachs committed Mar 29, 2020
1 parent 3a3f3c7 commit 92f45f1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gui/components/gui_flowtext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void gui_flowtext_intern_t::set_text(const char *text)
}

// parse a tag (not allowed to exceed sizeof(word) letters)
for (int i = 0; *lead != '>' && *lead > 0 && i < sizeof(word)-2; i++) {
for (uint i = 0; *lead != '>' && *lead > 0 && i+2 < sizeof(word); i++) {
lead++;
}

Expand Down Expand Up @@ -251,7 +251,7 @@ void gui_flowtext_intern_t::set_text(const char *text)

// parse a word (and obey limits)
att = ATT_NONE;
for( int i = 0; *lead != '<' && (*lead > 32 || (i==0 && *lead==32)) && i < sizeof(word)-1 && *lead != '&'; i++) {
for( uint i = 0; *lead != '<' && (*lead > 32 || (i==0 && *lead==32)) && i+1 < sizeof(word) && *lead != '&'; i++) {
if( *lead>128 ) {
size_t len = 0;
utf32 symbol = utf8_decoder_t::decode(lead, len);
Expand Down Expand Up @@ -370,10 +370,8 @@ scr_size gui_flowtext_intern_t::output(scr_coord offset, bool doit, bool return_
int max_width = width;
int text_width = width;
const int space_width = proportional_string_width(" ");
attributes last_node = ATT_NONE;

FOR(slist_tpl<node_t>, const& i, nodes) {
last_node = i.att;
switch (i.att) {
case ATT_NONE:
case ATT_NO_SPACE: {
Expand Down

0 comments on commit 92f45f1

Please sign in to comment.