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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6377) Unexplicit error message in cm.c
From: "Remi Bonnet" <remi.bonnet@xxxxxxxxxxx>
Date: Thu, 2 Oct 2003 10:04:54 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[jdorje - Thu Oct  2 16:46:46 2003]:

> 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().
> 

Fixed

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

Remi
--- ../freeciv/common/aicore/cm.c       2003-10-02 15:11:11.000000000 +0200
+++ ./common/aicore/cm.c        2003-10-02 19:01:32.000000000 +0200
@@ -1509,8 +1509,8 @@
   case SCIENCE:
     return _("Science");
   default:
-    assert(0);
-    return "ERROR";
+    die("Unknown stat value in cm_get_stat_name: %d", stat);
+    return NULL;
   }
 }
 

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