changeset 672:dfc3ec149b60

Remove trailing whitespaces and not mmap 0 sized bounce index file
author mmj
date Fri, 31 Oct 2008 23:29:44 +1100
parents fc2feb97cbb8
children d0a7bd17f13d
files src/mlmmj-bounce.c src/mlmmj-process.c
diffstat 2 files changed, 33 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/mlmmj-bounce.c	Fri Oct 31 09:27:53 2008 +1100
+++ b/src/mlmmj-bounce.c	Fri Oct 31 23:29:44 2008 +1100
@@ -68,6 +68,12 @@
 					bouncefile);
 	}
 
+	if(st.st_size == 0) {
+		log_error(LOG_ARGS, "Bounceindexfile %s is size 0",
+					bouncefile);
+		return NULL;
+	}
+
 	start = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
 	if(start == MAP_FAILED) {
 		log_error(LOG_ARGS, "Could not mmap bounceindexfile");
--- a/src/mlmmj-process.c	Fri Oct 31 09:27:53 2008 +1100
+++ b/src/mlmmj-process.c	Fri Oct 31 23:29:44 2008 +1100
@@ -699,6 +699,8 @@
 	addrtocc = !(statctrl(listdir, "tocc"));
 	if(addrtocc) {
 		for(i = 0; i < toemails.emailcount; i++) {
+			log_error(LOG_ARGS, "Found To: %s",
+				toemails.emaillist[i]);
 			for(j = 0; j < alternates->count; j++) {
 				chomp(alternates->strs[j]);
 				if(strcasecmp(alternates->strs[j],
@@ -707,6 +709,8 @@
 			}
 		}
 		for(i = 0; i < ccemails.emailcount; i++) {
+			log_error(LOG_ARGS, "Found Cc: %s",
+				ccemails.emaillist[i]);
 			for(j = 0; j < alternates->count; j++) {
 				chomp(alternates->strs[j]);
 				if(strcasecmp(alternates->strs[j],