dovecot: Make output a bit more cleaner.

dovecot at dovecot.org dovecot at dovecot.org
Sun Nov 4 15:00:23 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/3cd4b722baab
changeset: 6688:3cd4b722baab
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 04 15:00:20 2007 +0200
description:
Make output a bit more cleaner.

diffstat:

1 file changed, 6 insertions(+), 4 deletions(-)
src/util/idxview.c |   10 ++++++----

diffs (32 lines):

diff -r 294af3a8d974 -r 3cd4b722baab src/util/idxview.c
--- a/src/util/idxview.c	Sun Nov 04 14:48:16 2007 +0200
+++ b/src/util/idxview.c	Sun Nov 04 15:00:20 2007 +0200
@@ -306,7 +306,7 @@ static void dump_record(struct mail_inde
 	bool expunged;
 
 	rec = MAIL_INDEX_MAP_IDX(index->map, seq-1);
-	printf("RECORD: seq=%u, uid=%u, flags=0x%02x %s\n",
+	printf("\nRECORD: seq=%u, uid=%u, flags=0x%02x %s\n",
 	       seq, rec->uid, rec->flags, flags2str(rec->flags));
 
 	str = t_str_new(256);
@@ -317,14 +317,16 @@ static void dump_record(struct mail_inde
 			continue;
 
 		str_truncate(str, 0);
-		str_printfa(str, " - ext %d %s: ", i, ext[i].name);
+		str_printfa(str, " - ext %d %-10s: ", i, ext[i].name);
 		if (ext[i].record_size == sizeof(uint32_t) &&
 		    ext[i].record_align == sizeof(uint32_t))
-			str_printfa(str, "%u", *((const uint32_t *)data));
+			str_printfa(str, "%10u", *((const uint32_t *)data));
 		else if (ext[i].record_size == sizeof(uint64_t) &&
 			 ext[i].record_align == sizeof(uint64_t)) {
 			uint64_t value = *((const uint64_t *)data);
-			str_printfa(str, "%llu", (unsigned long long)value);
+			str_printfa(str, "%10llu", (unsigned long long)value);
+		} else {
+			str_append(str, "          ");
 		}
 		str_printfa(str, " (%s)",
 			    binary_to_hex(data, ext[i].record_size));


More information about the dovecot-cvs mailing list