table->length = length;
table->width = width;
table->flags = flags;
- table->col_flags = calloc(length, sizeof(int));
+ table->col_flags = calloc(width, sizeof(int));
table->entrys = 0;
- table->maxwidth = calloc(length, sizeof(int));
+ table->maxwidth = calloc(width, sizeof(int));
table->table_lines = NULL;
return table;
}
if(!(table->col_flags[col] & TABLE_FLAG_COL_CONTENTS)) continue;
if(table->col_flags[col] & TABLE_FLAG_COL_BOLD)
table->table_lines[row][pos++] = '\002';
+ i = 0;
if(table->contents[row][col]) {
- for(i = 0; i < strlen(table->contents[row][col]); i++) {
+ for(; i < strlen(table->contents[row][col]); i++) {
table->table_lines[row][pos++] = table->contents[row][col][i];
}
- } else {
- i = 4;
- table->table_lines[row][pos++] = 'N';
- table->table_lines[row][pos++] = 'U';
- table->table_lines[row][pos++] = 'L';
- table->table_lines[row][pos++] = 'L';
}
if(col < table->width-1) {
for(;i < table->maxwidth[col]; i++) {