dovecot-1.1: logview: Crashfix for CPUs requiring proper alignment.
dovecot at dovecot.org
dovecot at dovecot.org
Sun Oct 5 16:50:05 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/0414030ea17f
changeset: 7913:0414030ea17f
user: Timo Sirainen <tss at iki.fi>
date: Sun Oct 05 16:50:00 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 f55e58146f77 -r 0414030ea17f src/util/logview.c
--- a/src/util/logview.c Sun Oct 05 16:37:20 2008 +0300
+++ b/src/util/logview.c Sun Oct 05 16:50:00 2008 +0300
@@ -115,17 +115,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