*(b++) = ' ';
- sprintf(b, " %s\n", filename);
+ sprintf(b, "%s\n", filename);
}
void fancy_print(char *buffer, char *filename, size_sum_t size) {
height = forced_height;
}
+ if(forced_width) {
+ width = forced_width;
+ }
+
if(height >= 0 && nb_nodes > height && !show_top && !forced_height) {
printf("...\n");
}
} else {
raw_print(line, nodes[n]->name, nodes[n]->size);
}
- if(width >= 0 && width < BUFFER_SIZE) {
- line[width] = '\0';
+ if(width >= 1 && width + 1 < BUFFER_SIZE && line[width]) {
+ line[width] = '\n';
+ line[width + 1] = '\0';
}
printf(line);
}