<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40303 >

> [EMAIL PROTECTED] - Sun Jun 22 07:01:15 2008]:
> 
> Marko Lindqvist wrote:
> > <URL: http://bugs.freeciv.org/Ticket/Display.html?id=40303 >
> > 
> >  $subject
> > 
> >  To be committed soon.
> 
>     if (game.player_ptr) {
>       char *text;
> 
> -    if (game.player_ptr->is_ready) {
> +    if (game.player_ptr == NULL) {
> +      text = _("_Ready");
> +    } else if (game.player_ptr->is_ready) {
>         text = _("Not _ready");
>       } else {
>         int num_unready = 0;
> 
> This patch makes no sense.
> 
> How can game.player_ptr be NULL when 3 lines above there's a check to 
> see if it's non-NULL?

Conclusion: whatever crash you saw must be caused by something else
(likely, the buffer overrun I just fixed).  The code here is never
encountered when the player is a global observer (the button is
desensitized and the text left untouched, as the check up above skips
over this code block).  The patch should probably be reverted as it's
unnecessarily obfuscitory.

> And why is the text "Not ready" when the is_ready field is set?

Having looked at the code again I see that is the way it's supposed to be.

-jason


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to