X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=osl.c;h=4569b1bcf4810e1533c8283f1e72ae06d6f858e8;hb=1cb173045c9bbc707407021860a74a2dbc01af65;hp=d12b6b25ed00958172ef6102eb9cee4bf1030a70;hpb=e826876808b34d21a2c4af7f0e066a1b188a7a28;p=osl.git diff --git a/osl.c b/osl.c index d12b6b2..4569b1b 100644 --- a/osl.c +++ b/osl.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2009 Andre Noll + * Copyright (C) 2007-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -516,7 +516,7 @@ static int create_table_index(struct osl_table *t) strcpy(buf + offset + IDX_CD_NAME, cd->name); offset += index_column_description_size(cd->name); } - assert(offset = size); + assert(offset == size); filename = index_filename(t->desc); if (filename) ret = write_file(filename, buf, size); @@ -1045,6 +1045,7 @@ int init_rbtrees(struct osl_table *t) /* add valid rows to rbtrees */ t->num_invalid_rows = 0; for (i = 0; i < t->num_rows; i++) { + struct osl_object *volatile_objs; ret = row_is_invalid(t, i); if (ret < 0) return ret; @@ -1052,7 +1053,14 @@ int init_rbtrees(struct osl_table *t) t->num_invalid_rows++; continue; } - ret = add_row_to_rbtrees(t, i, NULL, NULL); + if (t->num_volatile_columns > 0) { + volatile_objs = calloc(t->num_volatile_columns, + sizeof(struct osl_object)); + if (!volatile_objs) + return -E_OSL_NOMEM; + } else + volatile_objs = NULL; + ret = add_row_to_rbtrees(t, i, volatile_objs, NULL); if (ret < 0) return ret; }