dovecot-2.1-pigeonhole: sieve-dump tool: Fixed hex output.

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Mon Sep 16 01:47:06 EEST 2013


details:   http://hg.rename-it.nl/dovecot-2.1-pigeonhole/rev/5b4b8d0cf0f3
changeset: 1698:5b4b8d0cf0f3
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Mon Sep 16 00:46:21 2013 +0200
description:
sieve-dump tool: Fixed hex output.
Messed up signed/unsigned characters.

diffstat:

 src/lib-sieve/sieve-binary-dumper.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 2b7472f55ec5 -r 5b4b8d0cf0f3 src/lib-sieve/sieve-binary-dumper.c
--- a/src/lib-sieve/sieve-binary-dumper.c	Mon Sep 16 00:43:55 2013 +0200
+++ b/src/lib-sieve/sieve-binary-dumper.c	Mon Sep 16 00:46:21 2013 +0200
@@ -218,10 +218,10 @@
 		buffer_t *blockbuf = sieve_binary_block_get_buffer(sblock);
 		string_t *line;
 		size_t data_size;
-		const char *data;
+		const unsigned char *data;
 		size_t offset;
 
-		data = (const char *) buffer_get_data(blockbuf, &data_size);
+		data = buffer_get_data(blockbuf, &data_size);
 
 		// FIXME: calculate offset more nicely.
 		sieve_binary_dump_sectionf
@@ -237,7 +237,7 @@
 			str_printfa(line, "%08llx  ", (unsigned long long) offset);
 
 			for ( b = 0; b < len; b++ ) {
-				str_printfa(line, "%02x ", (unsigned int) data[offset+b]);
+				str_printfa(line, "%02x ", data[offset+b]);
 				if ( b == 7 ) str_append_c(line, ' ');
 			}
 
@@ -252,10 +252,10 @@
 			str_append(line, " |");
 
 			for ( b = 0; b < len; b++ ) {
-				const char c = data[offset+b];
+				const unsigned char c = data[offset+b];
 
 				if ( c >= 32 && c <= 126 )
-					str_append_c(line, c);
+					str_append_c(line, (const char)c);
 				else
 					str_append_c(line, '.');
 			}


More information about the dovecot-cvs mailing list