summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-19 19:40:45 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-19 19:43:12 (GMT)
commit3aede31cfc354a756d3f5b0e0e985231285eaeaf (patch)
treed5049d0751c1400549e6b1fc2bd4b245c5a0b844 /Source/CursesDialog
parent2f3a356ea8dd8305ce4360c1652e2e5abfa9f1cf (diff)
downloadCMake-3aede31cfc354a756d3f5b0e0e985231285eaeaf.zip
CMake-3aede31cfc354a756d3f5b0e0e985231285eaeaf.tar.gz
CMake-3aede31cfc354a756d3f5b0e0e985231285eaeaf.tar.bz2
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.
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index 664ba2f..591c546 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -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;