ccmake: fix status line buffer overflow on very wide terminals

A mistyped length calculation will memset across stack frame when
the user's terminal width is larger than 270.
This commit is contained in:
Tianhao Chai 2018-03-09 13:04:44 -06:00 committed by Brad King
parent c1e087a9d3
commit 7899e53691

View File

@ -475,7 +475,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2);
if (curFieldLen + helpLen + 2 < width) {
memset(bar + curFieldLen + helpLen + 2, ' ',
width - curFieldLen + helpLen + 2);
width - (curFieldLen + helpLen + 2));
}
}
}