mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
ccmake: Check that getmaxyx result width is non-negative
Otherwise GCC 10.1 issues a `-Wstringop-overflow=` diagnostic when we use the width for indexing.
This commit is contained in:
@@ -68,7 +68,7 @@ void cmCursesLongMessageForm::UpdateStatusBar()
|
||||
bar[i] = ' ';
|
||||
}
|
||||
int width;
|
||||
if (x < cmCursesMainForm::MAX_WIDTH) {
|
||||
if (x >= 0 && x < cmCursesMainForm::MAX_WIDTH) {
|
||||
width = x;
|
||||
} else {
|
||||
width = cmCursesMainForm::MAX_WIDTH - 1;
|
||||
|
Reference in New Issue
Block a user