Skip to content

Commit 7f1e1b7

Browse files
Daniel LangeDaniel Lange
authored andcommitted
Merge branch 'screen-tab-bounds' of Explorer09/htop-1
2 parents e92007b + 64fce83 commit 7f1e1b7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ScreenManager.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,11 @@ static inline bool drawTab(const int* y, int* x, int l, const char* name, bool c
185185
return false;
186186
attrset(CRT_colors[cur ? SCREENS_CUR_BORDER : SCREENS_OTH_BORDER]);
187187
mvaddch(*y, *x, ']');
188-
*x += 1 + SCREEN_TAB_COLUMN_GAP;
189-
if (*x >= l)
188+
if (*x >= l - (1 + SCREEN_TAB_COLUMN_GAP)) {
189+
*x = l;
190190
return false;
191+
}
192+
*x += 1 + SCREEN_TAB_COLUMN_GAP;
191193
return true;
192194
}
193195

0 commit comments

Comments
 (0)