[Freeciv-tickets] [freeciv] #45917: fc_rand(): 'do { ... } while (size > 1)' run once for size == 1

Zurück zum Archiv-Index
OSDN Ticket System norep****@osdn*****
Tue Oct 18 17:37:45 JST 2022


#45917: fc_rand(): 'do {  ... } while (size > 1)' run once for size == 1

  Open Date: 2022-10-18 11:37
Last Update: 2022-10-18 11:37

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/45917
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45917

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-10-18 11:37 Updated by: cazfi
 * New Ticket "fc_rand(): 'do {  ... } while (size > 1)' run once for size == 1" created


---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: General
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

fc_rand() (actually fc_rand_debug() ) is not supposed to do any work for (size <= 1), as it even has a comment about initializing stuff for such size:
/*
* These assignments are only here to make the compiler
* happy. Since each usage is guarded with a if (size > 1).
*/
But the loop there is a "do ... while()" one, so it always execute once.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/45917
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45917



More information about the Freeciv-tickets mailing list
Zurück zum Archiv-Index