diff options
Diffstat (limited to 'mbbsd/admin.c')
-rw-r--r-- | mbbsd/admin.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index da7a79ca..e04999b9 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -236,17 +236,19 @@ setperms(unsigned int pbits, char * const pstring[]) clrtobot(); while ( (i = getkey("½Ð«ö [A-5] ¤Á´«³]©w¡A«ö [Return] µ²§ô¡G"))!='\r') - { - i = i - 'a'; - if (i < 0) - i = i + 'a' - '0' + 26; - if (i >= NUMPERMS) - bell(); + { + if (isdigit(i)) + i = i - '0' + 26; + else if (isalpha(i)) + i = tolower(i) - 'a'; else { - pbits ^= (1 << i); - move(i % 16 + 4, i <= 15 ? 24 : 64); - outs((pbits >> i) & 1 ? "£¾" : "¢æ"); + bell(); + continue; } + + pbits ^= (1 << i); + move(i % 16 + 4, i <= 15 ? 24 : 64); + outs((pbits >> i) & 1 ? "£¾" : "¢æ"); } return pbits; } |