From 17a559b3a5416ecbb61045a2aefcee44b7003b4f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 23 May 2010 18:04:23 +0200 Subject: [PATCH] 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. --- src/util/fairland.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/util/fairland.c b/src/util/fairland.c index 7d5c43ab..83ee883a 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; }