The patch below fixes the obivous problem: changing "0-0" to "0-9" in VALID_IN_EMAIL_ADD. It also does two more things:
Ideally, a small parser (a la lex & yacc) could be used for both email addresses and URLs to ensure proper identification.
Dave
-#define VALID_IN_EMAIL_ADD "a-zA-Z0-0_.-"
+#define VALID_IN_EMAIL_USERNAME "a-zA-Z0-9_.%-"
+#define VALID_IN_EMAIL_DOMAINNAME "a-zA-Z0-9.-"
/* check left side */
while (backoff) {
- if (sscanf(email, "%1[" VALID_IN_EMAIL_ADD "]", content)) {
+ if (sscanf(email, "%1[" VALID_IN_EMAIL_USERNAME "]", content)) {
email--;
backoff--;
}
_at_@ -587,7 +588,9 @@
}
if (email != ptr-1) { /* bigger chance this is an address */
email++;
- if (sscanf(ptr+1, "%255[" VALID_IN_EMAIL_ADD "]", mailbuff)) {
+ if (sscanf(ptr+1, "%255[" VALID_IN_EMAIL_DOMAINNAME "]",
+ mailbuff))
+ {
/* a valid mail right-end */
if (lastpos < email) {
Received on Fri 14 Aug 1998 08:37:39 PM GMT
This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:11 AM GMT GMT