summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tzsetup
diff options
context:
space:
mode:
authorjhay <jhay@FreeBSD.org>1997-02-01 17:03:10 +0000
committerjhay <jhay@FreeBSD.org>1997-02-01 17:03:10 +0000
commit1b1f32254770f1de0b98ee2d61a157223c5c530f (patch)
tree0a8f6ca72407bc413a0d4cccb9af220e485f0452 /usr.sbin/tzsetup
parentae22a22184972581580a0a4c754d2eb05ca0d1a3 (diff)
downloadFreeBSD-src-1b1f32254770f1de0b98ee2d61a157223c5c530f.zip
FreeBSD-src-1b1f32254770f1de0b98ee2d61a157223c5c530f.tar.gz
At the end it was much simpler than I thought. 26 * 26 = 676 and not 576.
South Africa and a few other countries exists again. This fix pr 2595. This should go into 2.2.
Diffstat (limited to 'usr.sbin/tzsetup')
-rw-r--r--usr.sbin/tzsetup/tzsetup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index e00bc37..f1d7d29 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -159,7 +159,8 @@ struct zone {
* of the two-letter variety, so we just size this array to suit.
* Beats worrying about dynamic allocation.
*/
-static struct country countries[26*26];
+#define NCOUNTRIES (26*26)
+static struct country countries[NCOUNTRIES];
#define CODE2INT(s) ((s[0] - 'A') * 26 + (s[1] - 'A'))
/*
@@ -291,7 +292,7 @@ compare_countries(const void *xa, const void *xb)
static void
sort_countries(void)
{
- qsort(countries, 576, sizeof countries[0], compare_countries);
+ qsort(countries, NCOUNTRIES, sizeof countries[0], compare_countries);
}
static void
OpenPOWER on IntegriCloud