(cnumb): Ignore countries not in use instead of countries with empty
names. Clearer and safer.
This commit is contained in:
parent
d21d7a0230
commit
c949d84774
1 changed files with 3 additions and 1 deletions
|
@ -53,12 +53,14 @@ cnumb(s_char *cntry)
|
|||
for (cn = 0; cn < MAXNOC; cn++) {
|
||||
if ((natp = getnatp(cn)) == 0)
|
||||
break;
|
||||
if (natp->nat_stat == STAT_UNUSED)
|
||||
continue;
|
||||
ncp = natp->nat_cnam;
|
||||
for (cp = cntry; *cp == *ncp; cp++, ncp++) {
|
||||
if (*cp == 0)
|
||||
return cn;
|
||||
}
|
||||
if (cp > cntry && *cp == 0) {
|
||||
if (*cp == 0) {
|
||||
best = cn;
|
||||
bcount++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue