#45629: fc_vsnprintf() documented to follow C99, implementation C89 one Open Date: 2022-09-10 01:14 Last Update: 2022-10-15 03:16 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/45629 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45629 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-10-15 03:16 Updated by: cazfi * Owner Update from (None) to cazfi * Resolution Update from None to Accepted Comment: Meant also to S2_6 --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: cazfi Type: Bugs Status: Open [Owner assigned] Priority: 5 - Medium MileStone: 3.0.5 Component: General Severity: 5 - Medium Resolution: Accepted --------------------------------------------------------------------- Ticket details: fc_vsnprintf() function header discuss return value, and states that C99 is followed: "If truncation does occur, returns the number of characters which would have been produced without truncation." The implementation, on the other hand, converts any C99 values to C89 (-1 on truncation), and not vice versa: /* Convert C99 return value to C89. */ if (r >= n) { return -1; } -- 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/45629 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45629