mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
RichString: implement safe rewind
The current rewind logic causes issues when rewinding over the short string optimization boundary.
This commit is contained in:

committed by
cgzones

parent
08ac22ddb9
commit
b9adc30b86
@ -113,7 +113,7 @@ void ProcessList_printHeader(const ProcessList* this, RichString* header) {
|
||||
|
||||
RichString_appendWide(header, color, alignedProcessFieldTitle(fields[i]));
|
||||
if (key == fields[i] && RichString_getCharVal(*header, RichString_size(header) - 1) == ' ') {
|
||||
header->chlen--; // rewind to override space
|
||||
RichString_rewind(header, 1); // rewind to override space
|
||||
RichString_appendnWide(header,
|
||||
CRT_colors[PANEL_SELECTION_FOCUS],
|
||||
CRT_treeStr[Settings_getActiveDirection(this->settings) == 1 ? TREE_STR_DESC : TREE_STR_ASC],
|
||||
|
Reference in New Issue
Block a user