/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* nat.c: Nation subroutines
*
* Known contributors to this file:
- * Markus Armbruster, 2008
+ * Markus Armbruster, 2009
+ * Ron Koenderink, 2008-2009
*/
#include <config.h>
natp->nat_update = 0;
natp->nat_tgms = 0;
- close(creat(mailbox(buf, natp->nat_cnum), S_IRWUG));
+ close(creat(mailbox(buf, natp->nat_cnum),
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
natp->nat_ann = 0; /* FIXME number of annos */
natp->nat_btu = stat == STAT_SANCT ? max_btus : 0;
{
struct natstr *natp;
natid cn;
- int nonb;
- char *temp;
+ int allblank;
+ char *p;
if (strlen(cname) >= sizeof(natp->nat_cnam)) {
pr("Country name too long\n");
return 0;
}
- nonb = 0;
- for (temp = cname; *temp != '\0'; temp++) {
- if (iscntrl(*temp)) {
+ allblank = 1;
+ for (p = cname; *p != '\0'; p++) {
+ if (iscntrl(*p)) {
pr("No control characters allowed in country names!\n");
return 0;
- } else if (!isspace(*temp))
- nonb = 1;
+ } else if (!isspace(*p))
+ allblank = 0;
}
- if (!nonb) {
+ if (allblank) {
pr("Country name can't be all blank\n");
return 0;
}