From e6fc72d3c6a44a1726b89166179679a40189bf00 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Tue, 29 Sep 2009 22:45:34 +0000 Subject: [PATCH] ITS#6303: fix broken variant of the struct hack --- servers/slapd/back-ldif/ldif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 9a4ad7ad56..128419341d 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -593,9 +593,9 @@ typedef struct bvlist { char *trunc; /* filename was truncated here */ int inum; /* num from "attr={num}" in filename, or INT_MIN */ char savech; /* original char at *trunc */ - char fname; /* variable length array BVL_NAME(bvl) = &fname */ -# define BVL_NAME(bvl) ((char *) (bvl) + offsetof(bvlist, fname)) -# define BVL_SIZE(namelen) (sizeof(bvlist) + (namelen)) + /* BVL_NAME(&bvlist) is the filename, allocated after the struct: */ +# define BVL_NAME(bvl) ((char *) ((bvl) + 1)) +# define BVL_SIZE(namelen) (sizeof(bvlist) + (namelen) + 1) } bvlist; static int -- 2.39.5