Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] Re: (PR#6377) Unexplicit error message in cm.c
Home

[Freeciv-Dev] Re: (PR#6377) Unexplicit error message in cm.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: remi.bonnet@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6377) Unexplicit error message in cm.c
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Oct 2003 09:46:47 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Remi Bonnet wrote:
> Although i don't think this part of the code maybe reached, the error
> message is not really explicit.

I think this is a code error; please use die().

If it is a user error rather than a code error, the string should be 
more informative and should be translated.

jason


> ------------------------------------------------------------------------
> 
> --- ../freeciv/common/aicore/cm.c     2003-10-02 15:11:11.000000000 +0200
> +++ ./common/aicore/cm.c      2003-10-02 18:12:47.000000000 +0200
> @@ -1509,8 +1509,8 @@
>    case SCIENCE:
>      return _("Science");
>    default:
> -    assert(0);
> -    return "ERROR";
> +    freelog(LOG_FATAL, "Unknown stat value in cm_get_stat_name: %d", stat);
> +    exit(EXIT_FAILURE);
>    }
>  }
>  





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