mirror of
https://github.com/otakuto/crazydiskinfo.git
synced 2025-08-08 15:13:35 +00:00
Format strings: use %s when printing strings
Otherwise the string itself could be interpreted as a format string. Suggested-by: g++
This commit is contained in:
parent
320c159409
commit
30ee4cde52
1 changed files with 3 additions and 3 deletions
6
main.cpp
6
main.cpp
|
@ -214,7 +214,7 @@ void drawVersion(WINDOW * window)
|
|||
auto title = " " + TITLE + "-" + VERSION + " ";
|
||||
|
||||
wattrset(window, COLOR_PAIR(TITLE_COLOR));
|
||||
mvwprintw(window, 0, (width - title.length()) / 2, title.c_str());
|
||||
mvwprintw(window, 0, (width - title.length()) / 2, "%s", title.c_str());
|
||||
wattroff(window, COLOR_PAIR(TITLE_COLOR));
|
||||
|
||||
wnoutrefresh(window);
|
||||
|
@ -247,7 +247,7 @@ void drawDeviceBar(WINDOW * window, std::vector<SMART> const & smartList, int se
|
|||
if (i == select)
|
||||
{
|
||||
wattrset(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
|
||||
mvwprintw(window, 2, x, smartList[i].deviceName.c_str());
|
||||
mvwprintw(window, 2, x, "%s", smartList[i].deviceName.c_str());
|
||||
wattroff(window, COLOR_PAIR(HEALTH_COLOR) | A_BOLD);
|
||||
|
||||
wattrset(window, COLOR_PAIR(HEALTH_COLOR));
|
||||
|
@ -256,7 +256,7 @@ void drawDeviceBar(WINDOW * window, std::vector<SMART> const & smartList, int se
|
|||
}
|
||||
else
|
||||
{
|
||||
mvwprintw(window, 2, x, smartList[i].deviceName.c_str());
|
||||
mvwprintw(window, 2, x, "%s", smartList[i].deviceName.c_str());
|
||||
mvwhline(window, 3, x, ' ', smartList[i].deviceName.length());
|
||||
}
|
||||
x += smartList[i].deviceName.length() + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue