<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40171 >
> [EMAIL PROTECTED] - Ven. Mar. 28 10:07:40 2008]: > > in freeciv version 2.1.3, gtk-2.0 client, in city report screen: > when I do "Select -> Cityzen Governor -> none" and there is at least > one city > with CMA active, then the client crashes on a failed assertion: > > civclient: cma_fec.c:178: cmafec_preset_get_parameter: Assertion > `index >= 0 > && index < cmafec_preset_num()' failed. > > This is because cmafec_preset_get_parameter gets CMA_NONE as an > argument. > It can be fixed by testing idx != CMA_NONE before calling > cmafec_preset_get_parameter. It is correct because if the city is > CMA-controlled (controlled !=0) and we are selecting non-controlled > cities > (idx == CMA_NONE), then we shouldn't select the city under > consideration > (select = FALSE). > > I attach a log of gdb session (gdb.log) which shows the problem and a > fix > (fix-client-CMA-select-none.diff). > > This problem has been added for PR#39722 at revisions from 14079 to 14082. The old value of CMA_NONE was -1, but a bug in the glib made developers changing to a positive value. You patch seems good. However, I think that it require some look more to be sure a such crash cannot occur somewhere else. _______________________________________________ Freeciv-dev mailing list [email protected] https://mail.gna.org/listinfo/freeciv-dev
