Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
Re: [Freeciv-Dev] xaw client Find City and Airlift/Goto dialogs report e
Home

Re: [Freeciv-Dev] xaw client Find City and Airlift/Goto dialogs report e

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jjm@xxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Freeciv-Dev] xaw client Find City and Airlift/Goto dialogs report empty malloc if no cities (PR#73)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Fri, 30 Jul 1999 11:47:43 +1000 (EST)

Jeff Mallatt wrote:

> In the xaw client, the Find City and Airlift/Goto dialogs report an empty
> malloc
> if opened when there are no cities.
> 
> This patch fixes the problem by simply disabling these menu items if the 
> player
> has no cities.

But those dialogs can still be useful if the player has no cities,
but knows of some enemy cities.

Maybe use a function in the client to return the number of cities
the player know.  May be slow though, in terms of doing lots
of menu updates...

Or just check explicitly for those dialogs if we are about to
fc_malloc(0), and do some other sensible thing if so.

Or even, in fc_malloc(), remove or downgrade that warning.  
(Although I kind of like the warning, since its convenient to 
consider fc_malloc to guarantee always returning non-NULL (or 
die() in the attempt), but this is one case where it _will_ 
return NULL.)

Regards,
-- David

[Prev in Thread] Current Thread [Next in Thread]