From 3aede31cfc354a756d3f5b0e0e985231285eaeaf Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 19 May 2020 15:40:45 -0400 Subject: 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. --- Source/CursesDialog/cmCursesLongMessageForm.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v0.12