changeset 414:309935f59820

Minor refactoring and added a newline to the debug output.
author markus schnalke <meillo@marmaro.de>
date Wed, 29 Feb 2012 14:23:16 +0100 (2012-02-29)
parents 7c5e51c53f72
children 0430194f7ef8
files src/spool.c
diffstat 1 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/spool.c	Wed Feb 29 14:22:44 2012 +0100
+++ b/src/spool.c	Wed Feb 29 14:23:16 2012 +0100
@@ -73,17 +73,18 @@
 {
 	address *rcpt = NULL;
 
-	if (line[3] != '\0') {
-		if (line[4] != '|') {
-			rcpt = create_address(&(line[4]), TRUE);
-		} else {
-			rcpt = create_address_pipe(&(line[4]));
-		}
-		if (line[3] == 'X') {
-			addr_mark_delivered(rcpt);
-		} else if (line[3] == 'F') {
-			addr_mark_failed(rcpt);
-		}
+	if (!line[3]) {
+		return NULL;
+	}
+	if (line[4] == '|') {
+		rcpt = create_address_pipe(line+4);
+	} else {
+		rcpt = create_address(line+4, TRUE);
+	}
+	if (line[3] == 'X') {
+		addr_mark_delivered(rcpt);
+	} else if (line[3] == 'F') {
+		addr_mark_failed(rcpt);
 	}
 	return rcpt;
 }
@@ -147,7 +148,8 @@
 			break;
 		} else if (strncasecmp(buf, "MF:", 3) == 0) {
 			msg->return_path = create_address(&(buf[3]), TRUE);
-			DEBUG(3) debugf("spool_read: MAIL FROM: %s", msg->return_path->address);
+			DEBUG(3) debugf("spool_read: MAIL FROM: %s\n",
+					msg->return_path->address);
 		} else if (strncasecmp(buf, "RT:", 3) == 0) {
 			address *addr;
 			addr = spool_scan_rcpt(buf);