Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] Re: (PR#13527) fix AI log crash
Home

[Freeciv-Dev] Re: (PR#13527) fix AI log crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#13527) fix AI log crash
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 24 Jul 2005 11:53:25 -0700
Reply-to: bugs@xxxxxxxxxxx

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

On Sun, 24 Jul 2005, Jason Short wrote:
> The attached patch avoids a crash in the AI log code.
> get_improvement_name is called on the value of 199 which is an illegal
> dereference.
>
> Interestingly the "best" struct has 199 as its choice field, with
> best->type as CT_BUILDING.I assume this is used as an intentionally
> invalid value.However this is wrong because 199 could be valid if
> there were 200 buildings (the maximum).

If the code is wrong, either remove it or add a comment about its
wrongness (or fix it), do not leave it there for someone else to try to
make use of later.

 - Per





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#13527) fix AI log crash, Per I. Mathisen <=