]> git.sur5r.net Git - openldap/commitdiff
ISO C forbids zero-size array (ITS#3739)
authorPierangelo Masarati <ando@openldap.org>
Sat, 21 May 2005 00:08:28 +0000 (00:08 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 21 May 2005 00:08:28 +0000 (00:08 +0000)
servers/slapd/bconfig.c

index 3a1d41969b93f46653e1ecd2059b007a49836c03..de62eae2749cad52d285e52e33ed7cdcd3fc19c8 100644 (file)
@@ -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) + * sizeof(int));
+                               d = ch_malloc( sizeof(delrec) + (i - 1)* sizeof(int));
                                d->nidx = i;
                                d->next = NULL;
                                if ( dels ) {