From: Pierangelo Masarati Date: Sat, 21 May 2005 00:08:28 +0000 (+0000) Subject: ISO C forbids zero-size array (ITS#3739) X-Git-Tag: OPENLDAP_AC_BP~625 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e799b27eed270f7e9458c3119a376ca35817f304;p=openldap ISO C forbids zero-size array (ITS#3739) --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 3a1d41969b..de62eae274 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -3167,7 +3167,7 @@ out: typedef struct delrec { struct delrec *next; int nidx; - int idx[0]; + int idx[1]; } delrec; static int @@ -3226,7 +3226,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs, if ( ct && ml->sml_values ) { delrec *d; for (i=0; ml->sml_values[i].bv_val; i++); - d = ch_malloc( sizeof(delrec) + i * sizeof(int)); + d = ch_malloc( sizeof(delrec) + (i - 1)* sizeof(int)); d->nidx = i; d->next = NULL; if ( dels ) {