Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8749) Scenario fixes
Home

[Freeciv-Dev] Re: (PR#8749) Scenario fixes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8749) Scenario fixes
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 May 2004 16:18:33 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8749 >

Per Inge Mathisen wrote:

> +    str = secfile_lookup_str_default(file, NULL, "map.r%dsnation", i);
> +    if (str != NULL) {
> +      map.start_positions[i].nation = find_nation_by_name_orig(str);
> +    } else {
> +      map.start_positions[i].nation = i; /* and hope for the best... */
> +    }
>      i++;
>    }

There's a bug here.  find_nation_by_name_orig can return 
NO_NATION_SELECTED (-1) if the nations isn't present, but you don't 
handle this either here or later.  This is a user error so it should 
either be handled or the server should exit gracefully.

jason




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