projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4c155eb
)
fixed Tables maxwidth array (needs to have as many fields as columns not as many...
author
pk910
<philipp@zoelle1.de>
Sun, 2 Oct 2011 17:05:10 +0000
(19:05 +0200)
committer
pk910
<philipp@zoelle1.de>
Sun, 2 Oct 2011 17:27:48 +0000
(19:27 +0200)
src/tools.c
patch
|
blob
|
history
diff --git
a/src/tools.c
b/src/tools.c
index 43f27cd35ac052148a7c39247aaeea4dbf78a0b2..fa187b614826ae68c00b58831545ad382e9d5140 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-106,9
+106,9
@@
struct Table *table_init(int width, int length, int flags) {
table->length = length;
table->width = width;
table->flags = flags;
table->length = length;
table->width = width;
table->flags = flags;
- table->col_flags = calloc(
leng
th, sizeof(int));
+ table->col_flags = calloc(
wid
th, sizeof(int));
table->entrys = 0;
table->entrys = 0;
- table->maxwidth = calloc(
leng
th, sizeof(int));
+ table->maxwidth = calloc(
wid
th, sizeof(int));
table->table_lines = NULL;
return table;
}
table->table_lines = NULL;
return table;
}
@@
-179,16
+179,11
@@
char **table_end(struct Table *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';
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]) {
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];
}
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++) {
}
if(col < table->width-1) {
for(;i < table->maxwidth[col]; i++) {