NM/01
[exim.git] / src / src / moan.c
index 5ef5fe42c3049ca508d573b204d740bdc06f6e34..1b6d1a97fe6006a999d9e52e8c1cafd63ab50b82 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/moan.c,v 1.8 2007/02/06 11:11:40 ph10 Exp $ */
+/* $Cambridge: exim/src/src/moan.c,v 1.10 2007/08/29 15:06:47 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -584,7 +584,7 @@ if (errors_copy == NULL) return NULL;
 length of the local part. */
 
 localpart = recipient;
-domain = Ustrchr(recipient, '@');
+domain = Ustrrchr(recipient, '@');
 if (domain == NULL) return NULL;  /* should not occur, but avoid crash */
 llen = domain++ - recipient;
 
@@ -610,10 +610,7 @@ while ((item = string_nextinlist(&listptr, &sep, buffer, sizeof(buffer)))
   if (match_address_list(recipient, TRUE, TRUE, &pattern, NULL, 0, UCHAR_MAX+1,
         NULL) == OK)
     {
-    uschar temp[256];
-    Ustrncpy(temp, localpart, llen);
-    temp[llen] = 0;
-    deliver_localpart = temp;
+    deliver_localpart = string_copyn(localpart, llen);
     deliver_domain = domain;
     yield = expand_string_copy(newaddress);
     deliver_domain = deliver_localpart = NULL;