dovecot-1.2: logview: Crashfix for CPUs requiring proper alignment.

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 5 16:50:08 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/93e01a80cb8e
changeset: 8238:93e01a80cb8e
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 05 16:49:48 2008 +0300
description:
logview: Crashfix for CPUs requiring proper alignment.

diffstat:

1 file changed, 12 insertions(+), 3 deletions(-)
src/util/logview.c |   15 ++++++++++++---

diffs (33 lines):

diff -r 5adb665bfc0c -r 93e01a80cb8e src/util/logview.c
--- a/src/util/logview.c	Sun Oct 05 16:37:38 2008 +0300
+++ b/src/util/logview.c	Sun Oct 05 16:49:48 2008 +0300
@@ -137,17 +137,26 @@ static void print_try_uint(const void *d
 	}
 	case 2: {
 		const uint16_t *n = data;
-		printf("%u", *n);
+		uint32_t n16;
+
+		memcpy(&n16, n, sizeof(n16));
+		printf("%u", n16);
 		break;
 	}
 	case 4: {
 		const uint32_t *n = data;
-		printf("%u", *n);
+		uint32_t n32;
+
+		memcpy(&n32, n, sizeof(n32));
+		printf("%u", n32);
 		break;
 	}
 	case 8: {
 		const uint64_t *n = data;
-		printf("%llu", (unsigned long long)*n);
+		uint64_t n64;
+
+		memcpy(&n64, n, sizeof(n64));
+		printf("%llu", (unsigned long long)n64);
 		break;
 	}
 	default:


More information about the dovecot-cvs mailing list