From: djk Date: Tue, 28 Mar 2000 22:23:15 +0000 (+0000) Subject: do better callsign checking X-Git-Tag: R_1_39a~1 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=832a431fea2f4ac3b1c2fb04a61e75f91e8e0259;p=spider.git do better callsign checking --- diff --git a/src/client.c b/src/client.c index e22d84ac..5258e39d 100644 --- a/src/client.c +++ b/src/client.c @@ -91,10 +91,22 @@ int tabsize = 8; /* default tabsize for text messages */ myregex_t iscallreg[] = { /* regexes to determine whether this is a reasonable callsign */ { - "^[A-Z]+[0-9]+[A-Z]+", 0 + "^[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0 }, { - "^[0-9]+[A-Z]+[0-9]+[A-Z]+", 0 + "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0 + }, + { + "^[A-Z]+[0-9]+[A-Z]+[1-9]?-[1-9]$", 0 + }, + { + "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?-[1-9]$", 0 + }, + { + "^[A-Z]+[0-9]+[A-Z]+[1-9]?-1[0-5]$", 0 + }, + { + "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?-1[0-5]$", 0 }, { 0, 0 @@ -714,9 +726,11 @@ main(int argc, char *argv[]) } buf[r] = 0; call = strupper(buf); - if (!iscallsign(call)) { - die("Sorry, %s isn't a valid callsign", buf); - } + } + + /* check the callsign */ + if (!iscallsign(call)) { + die("Sorry, %s isn't a valid callsign", call); } /* connect up stdin */