From 6f4b6d5872c320343b52ae1cf1ff6d55a7fb05e5 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 23 Nov 2013 09:30:35 +0100 Subject: [PATCH] alignof: handle sizeof(t) == 1 case --- src/marshal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/marshal.c b/src/marshal.c index 88660090..45c46cbc 100644 --- a/src/marshal.c +++ b/src/marshal.c @@ -31,7 +31,7 @@ #include "lldpd-structs.h" /* Stolen from CCAN */ -#define ALIGNOF(t) ((char *)(&((struct { char c; t _h; } *)0)->_h) - (char *)0) +#define ALIGNOF(t) ((sizeof(t) > 1)?((char *)(&((struct { char c; t _h; } *)0)->_h) - (char *)0):1) /* A serialized object */ struct marshal_serialized { -- 2.39.5