dbus-top: use mvwaddstr when no arguments are needed
Currently, some of the code uses mvwprintw to print a string without
using a format string, this causes the following errors:
error: format not a string literal and no format arguments
[-Werror=format-security]
The fix is to use mvwaddstr when no arguments are needed.
Signed-off-by: Sui Chen <suichen@google.com>
Change-Id: Ib17ad7a7795cb7bf77161f8730139f38216b7aba
(cherry picked from commit 58f2806fe8400e0f9663c4fd58955521c6f5794d)
diff --git a/main.cpp b/main.cpp
index d56b72e..5293f9b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -98,12 +98,12 @@
ret++;
if (static_cast<int>(txt.size()) > width)
{
- mvwprintw(win, y, x, txt.substr(0, width).c_str());
+ mvwaddstr(win, y, x, txt.substr(0, width).c_str());
txt = txt.substr(width);
}
else
{
- mvwprintw(win, y, x, txt.c_str());
+ mvwaddstr(win, y, x, txt.c_str());
break;
}
y++;