dovecot-2.2: auth: auth_stream_reply_remove() left extra TABs to...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 25 04:38:39 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/52e8a1346d2e
changeset: 14154:52e8a1346d2e
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Feb 25 04:38:01 2012 +0200
description:
auth: auth_stream_reply_remove() left extra TABs to stream.
Normally this wouldn't really affect anything, except log some extra debug
messages.

diffstat:

 src/auth/auth-stream.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (26 lines):

diff -r ce1fd6eefeff -r 52e8a1346d2e src/auth/auth-stream.c
--- a/src/auth/auth-stream.c	Sat Feb 25 03:46:10 2012 +0200
+++ b/src/auth/auth-stream.c	Sat Feb 25 04:38:01 2012 +0200
@@ -76,15 +76,16 @@
 	if (!auth_stream_reply_find_area(reply, key, &idx, &len))
 		return;
 
-	if (str_len(reply->str) < idx + len) {
-		/* remove also trailing tab */
-		len++;
-	} else if (str_len(reply->str) == idx + len && idx > 0) {
-		/* removing last item, remove preceding tab */
+	if (idx == 0 && str_len(reply->str) == len) {
+		/* removing the only item */
+	} else if (str_len(reply->str) == idx + len) {
+		/* removing the last item -> remove the preceding tab */
 		len++;
 		idx--;
+	} else {
+		/* remove the trailing tab */
+		len++;
 	}
-
 	str_delete(reply->str, idx, len);
 }
 


More information about the dovecot-cvs mailing list