changeset 251:030c41dfd9ba noffle

[svn] * src/protocol.c: Change strcpy to Utl_strcpy and replace ascii check with isascii().
author bears
date Wed, 26 Jun 2002 14:13:26 +0100
parents 93d5d8b098da
children ce4dd5d6530b
files src/protocol.c
diffstat 1 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocol.c	Wed Jun 05 23:03:44 2002 +0100
+++ b/src/protocol.c	Wed Jun 26 14:13:26 2002 +0100
@@ -1,7 +1,7 @@
 /*
   protocol.c
 
-  $Id: protocol.c 382 2002-06-05 22:03:44Z mirkol $
+  $Id: protocol.c 383 2002-06-26 13:13:26Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -301,26 +301,20 @@
     p = strchr( msgId, '@' );
     if ( msgId[ 0 ] != '<' || msgId[ len - 1 ] != '>' || p == NULL )
         return FALSE;
-    strcpy( domain, p + 1 );
+    Utl_cpyStr( domain, p + 1 );
     domain[ strlen( domain ) - 1 ] = '\0';
     headLen = p - msgId - 1;
     Utl_cpyStrN( head, msgId + 1, headLen );
     head[ headLen ] = '\0';
     for ( p = msgId ; *p != '\0' ; p++ )
     {
-        if ( ( (unsigned char ) *p ) >= 128 )
-            return FALSE; /* pure 7bit ASCII */
+        if ( ! isascii( *p ) )
+            return FALSE;
     }
     if ( strpbrk( head, specials ) )
         return FALSE; 
     if ( strpbrk( domain, specials ) )
         return FALSE;
-    /*
-      To do: Maybe compare domain with a config option 
-      and replace it by the config option, if not equal.
-     */
-    if ( strchr( domain, '.' ) == NULL )
-        return FALSE;
     return TRUE;
 }