[dovecot-cvs] dovecot/src/lib-mail message-header-decode.c, 1.8, 1.9

tss at dovecot.org tss at dovecot.org
Tue Apr 3 16:55:10 EEST 2007


Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv30495

Modified Files:
	message-header-decode.c 
Log Message:
Minor optimization.



Index: message-header-decode.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-header-decode.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- message-header-decode.c	15 Dec 2006 18:10:57 -0000	1.8
+++ message-header-decode.c	3 Apr 2007 13:55:08 -0000	1.9
@@ -77,8 +77,8 @@
 		}
 	}
 
-	ret = callback(buffer_get_data(decodebuf, NULL),
-		       buffer_get_used_size(decodebuf), charset, context);
+	ret = decodebuf->used == 0 ? FALSE :
+		callback(decodebuf->data, decodebuf->used, charset, context);
 
 	t_pop();
 	return ret;
@@ -114,5 +114,8 @@
 		}
 	}
 
-	(void)callback(data + start_pos, size - start_pos, NULL, context);
+	if (size > start_pos) {
+		(void)callback(data + start_pos, size - start_pos,
+			       NULL, context);
+	}
 }



More information about the dovecot-cvs mailing list