RichString: refactor writing limited amount of columns

Closes: #468
This commit is contained in:
Christian Göttsche
2021-01-14 09:59:11 +01:00
committed by cgzones
parent ceee96dcba
commit 08ac22ddb9
3 changed files with 45 additions and 3 deletions

View File

@ -245,8 +245,9 @@ void Process_outputRate(RichString* str, char* buffer, size_t n, double rate, in
}
void Process_printLeftAlignedField(RichString* str, int attr, const char* content, unsigned int width) {
int c = RichString_appendnWide(str, attr, content, MINIMUM(width, strlen(content)));
RichString_appendChr(str, attr, ' ', width + 1 - c);
int columns = width;
RichString_appendnWideColumns(str, attr, content, strlen(content), &columns);
RichString_appendChr(str, attr, ' ', width + 1 - columns);
}
void Process_writeField(const Process* this, RichString* str, ProcessField field) {