Use variable-length arrays instead of alloca.

This commit is contained in:
Nicolas Tsiftes 2012-01-10 11:38:33 +01:00
parent c6abd58340
commit 343b2376c0
2 changed files with 9 additions and 15 deletions

View file

@ -475,19 +475,17 @@ relation_remove(char *name, int remove_tuples)
db_result_t
relation_insert(relation_t *rel, attribute_value_t *values)
{
size_t size;
attribute_t *attr;
storage_row_t record;
unsigned char record[rel->row_length];
unsigned char *ptr;
attribute_value_t *value;
db_result_t result;
value = values;
size = rel->row_length;
PRINTF("DB: Relation %s has a record size of %d bytes\n",
rel->name, (int)size);
ptr = record = alloca(size);
PRINTF("DB: Relation %s has a record size of %u bytes\n",
rel->name, (unsigned)rel->row_length);
ptr = record;
PRINTF("DB: Insert (");