diff options
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1034,7 +1034,7 @@ rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2) typedef struct node_buffer_elem_struct { struct node_buffer_elem_struct *next; - NODE buf[1]; /* flexible array */ + NODE buf[FLEX_ARY_LEN]; } node_buffer_elem_t; struct node_buffer_struct { @@ -1046,7 +1046,7 @@ struct node_buffer_struct { static node_buffer_t * rb_node_buffer_new(void) { - node_buffer_t *nb = xmalloc(offsetof(node_buffer_t, body) + offsetof(node_buffer_elem_t, buf) + 16 * sizeof(NODE)); + node_buffer_t *nb = xmalloc(sizeof(node_buffer_t) + 16 * sizeof(NODE)); nb->idx = 0; nb->len = 16; nb->head = &nb->body; |