#45917: fc_rand(): 'do { ... } while (size > 1)' run once for size == 1 Open Date: 2022-10-18 11:37 Last Update: 2022-12-04 17:20 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-12-04 17:20 Updated by: cazfi * Milestone Update from (None) to 3.0.6 --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: (None) Type: Bugs Status: Open Priority: 5 - Medium MileStone: 3.0.6 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