1 Star 0 Fork 7

wangchen/powertop

forked from src-openEuler/powertop 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-src-fix-compatibility-with-ncurses-6.3.patch 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
wangchen 提交于 2022-02-24 16:27 . fix compatibility with ncurses-6.3
From 9ef1559a1582f23d599c149601c3a8e06809296c Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <[email protected]>
Date: Mon, 25 Oct 2021 17:47:23 +0200
Subject: [PATCH] src: fix compatibility with ncurses 6.3
Signed-off-by: Alexander Kanavin <[email protected]>
---
src/devices/devfreq.cpp | 2 +-
src/display.cpp | 2 +-
src/lib.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp
index 0509d0f..b194ac4 100644
--- a/src/devices/devfreq.cpp
+++ b/src/devices/devfreq.cpp
@@ -297,7 +297,7 @@ void display_devfreq_devices(void)
df->fill_freq_utilization(j, buf);
strcat(fline, buf);
strcat(fline, "\n");
- wprintw(win, fline);
+ wprintw(win, "%s", fline);
}
wprintw(win, "\n");
}
diff --git a/src/display.cpp b/src/display.cpp
index 7131144..cc03919 100644
--- a/src/display.cpp
+++ b/src/display.cpp
@@ -125,7 +125,7 @@ void show_tab(unsigned int tab)
c = bottom_lines[tab_names[tab]].c_str();
if (c && strlen(c) > 0)
- mvwprintw(bottom_line, 0,0, c);
+ mvwprintw(bottom_line, 0,0, "%s", c);
else
mvwprintw(bottom_line, 0, 0,
"<ESC> %s | <TAB> / <Shift + TAB> %s | ", _("Exit"),
diff --git a/src/lib.cpp b/src/lib.cpp
index 5e48f37..5cd1c4a 100644
--- a/src/lib.cpp
+++ b/src/lib.cpp
@@ -583,7 +583,7 @@ void ui_notify_user_ncurses(const char *frmt, ...)
* buffer */
vsnprintf(notify, UI_NOTIFY_BUFF_SZ - 1, frmt, list);
va_end(list);
- mvprintw(1, 0, notify);
+ mvprintw(1, 0, "%s", notify);
attroff(COLOR_PAIR(1));
}
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangchen2020/powertop.git
[email protected]:wangchen2020/powertop.git
wangchen2020
powertop
powertop
master

搜索帮助