From: Markus Armbruster Date: Sun, 23 May 2010 16:04:23 +0000 (+0200) Subject: Use assert() for a condition that should never happen in fairland X-Git-Tag: v4.3.26~4 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=17a559b3a5416ecbb61045a2aefcee44b7003b4f Use assert() for a condition that should never happen in fairland If it does happen, assertion failure isn't very nice, but it beats asking the user to report the bug to an inappropriate e-mail address that most probably ceased to work years ago. --- diff --git a/src/util/fairland.c b/src/util/fairland.c index 7d5c43aba..83ee883a1 100644 --- a/src/util/fairland.c +++ b/src/util/fairland.c @@ -66,6 +66,7 @@ static int quiet = 0; /* lower URAN_MIN for more uranium */ #define URAN_MIN 56 +#include #include #include #include @@ -688,12 +689,8 @@ new_try(int c) return i; i = (i + 1) % secs; } while (i != starti); - if (c < nc) { - printf("fairland: BUG -- couldn't find coast for continent %c, sector %d.\nPlease mail stevens@math.utoronto.ca.\n", - c + 'a', secs); - exit(1); - } else - return -1; + assert(c >= nc); + return -1; } return -1; }