diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2015-09-12 14:35:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-16 12:42:20 (GMT) |
commit | 6c442e5a899e07a85038c4f9c65dfe224ac9485e (patch) | |
tree | 67e6442a07c3c25a718dcf3d431844ed07fe8932 /Source/CursesDialog/cmCursesMainForm.cxx | |
parent | 6dad4c25b06ae232c766d76747b080373fb2499d (diff) | |
download | CMake-6c442e5a899e07a85038c4f9c65dfe224ac9485e.zip CMake-6c442e5a899e07a85038c4f9c65dfe224ac9485e.tar.gz CMake-6c442e5a899e07a85038c4f9c65dfe224ac9485e.tar.bz2 |
ccmake: Pass format string to 'printw' (#15738)
printw takes a format string as first argument, so don't pass variable
strings to it directly.
Diffstat (limited to 'Source/CursesDialog/cmCursesMainForm.cxx')
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index be17a9f..a2fc2c0 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -451,24 +451,25 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) } curses_move(y-4,0); + char fmt_s[] = "%s"; char fmt[512] = "Press [enter] to edit option"; if ( process ) { strcpy(fmt, " "); } - printw(fmt); + printw(fmt_s, fmt); curses_move(y-3,0); - printw(firstLine); + printw(fmt_s, firstLine); curses_move(y-2,0); - printw(secondLine); + printw(fmt_s, secondLine); curses_move(y-1,0); - printw(thirdLine); + printw(fmt_s, thirdLine); if (cw) { sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages); curses_move(0,65-static_cast<unsigned int>(strlen(firstLine))-1); - printw(firstLine); + printw(fmt_s, firstLine); } // } @@ -612,13 +613,13 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) version[width] = '\0'; // Now print both lines + char fmt_s[] = "%s"; curses_move(y-5,0); attron(A_STANDOUT); - char format[] = "%s"; - printw(format, bar); + printw(fmt_s, bar); attroff(A_STANDOUT); curses_move(y-4,0); - printw(version); + printw(fmt_s, version); pos_form_cursor(this->Form); } |