#45689: sdl2: redraw_ibutton() return value Open Date: 2022-09-23 07:00 Last Update: 2022-12-31 03:31 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/45689 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45689 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-12-31 03:31 Updated by: cazfi * Owner Update from (None) to cazfi * Resolution Update from None to Accepted --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: cazfi Type: Bugs Status: Open [Owner assigned] Priority: 5 - Medium MileStone: 3.0.6 Component: SDL2-client Severity: 5 - Medium Resolution: Accepted --------------------------------------------------------------------- Ticket details: redraw_ibutton() header says: "function return (-1) if there are no Icon nor Text. Else return 0." In reality there's also a return like this: ret = alphablit(pIcon, NULL, pIButton->dst->surface, &dest, 255); if (ret) { FREESURFACE(pText); return ret - 10; } I guess that should return just '-1'. As any non-zero alphablit() return value is considered an error, above can even result in 10 - 10 = 0, like there was no error at all from redraw_ibutton() Further, there's another alphablit() call where the success is not checked at all. -- 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/45689 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45689