mirror of
https://git.yoctoproject.org/poky
synced 2026-03-19 13:49:41 +01:00
gptfdisk: address ncurses 6.3 compatibility
(From OE-Core rev: 1a5254939a72319ffcd302449c0187c0383da0c9) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
77c631a6f9
commit
b3d1a8ac9b
@@ -0,0 +1,99 @@
|
||||
From e301f7dd650c9e56f954a7c49661d938079e1a9b Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex@linutronix.de>
|
||||
Date: Mon, 25 Oct 2021 17:27:51 +0200
|
||||
Subject: [PATCH] gptcurses: correct ncurses 6.3 errors
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
---
|
||||
gptcurses.cc | 28 ++++++++++++++--------------
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/gptcurses.cc b/gptcurses.cc
|
||||
index d0de024..70be999 100644
|
||||
--- a/gptcurses.cc
|
||||
+++ b/gptcurses.cc
|
||||
@@ -235,22 +235,22 @@ Space* GPTDataCurses::ShowSpace(int spaceNum, int lineNum) {
|
||||
ClearLine(lineNum);
|
||||
if (space->partNum == -1) { // space is empty
|
||||
move(lineNum, 12);
|
||||
- printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str());
|
||||
+ printw("%s",BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str());
|
||||
move(lineNum, 24);
|
||||
- printw("free space");
|
||||
+ printw("%s","free space");
|
||||
} else { // space holds a partition
|
||||
move(lineNum, 3);
|
||||
printw("%d", space->partNum + 1);
|
||||
move(lineNum, 12);
|
||||
- printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str());
|
||||
+ printw("%s",BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str());
|
||||
move(lineNum, 24);
|
||||
- printw(space->origPart->GetTypeName().c_str());
|
||||
+ printw("%s",space->origPart->GetTypeName().c_str());
|
||||
move(lineNum, 50);
|
||||
#ifdef USE_UTF16
|
||||
space->origPart->GetDescription().extract(0, 39, temp, 39);
|
||||
- printw(temp);
|
||||
+ printw("%s",temp);
|
||||
#else
|
||||
- printw(space->origPart->GetDescription().c_str());
|
||||
+ printw("%s",space->origPart->GetDescription().c_str());
|
||||
#endif
|
||||
} // if/else
|
||||
} // if
|
||||
@@ -267,10 +267,10 @@ int GPTDataCurses::DisplayParts(int selected) {
|
||||
|
||||
move(lineNum++, 0);
|
||||
theLine = "Part. # Size Partition Type Partition Name";
|
||||
- printw(theLine.c_str());
|
||||
+ printw("%s",theLine.c_str());
|
||||
move(lineNum++, 0);
|
||||
theLine = "----------------------------------------------------------------";
|
||||
- printw(theLine.c_str());
|
||||
+ printw("%s",theLine.c_str());
|
||||
numToShow = LINES - RESERVED_TOP - RESERVED_BOTTOM;
|
||||
pageNum = selected / numToShow;
|
||||
for (i = pageNum * numToShow; i <= (pageNum + 1) * numToShow - 1; i++) {
|
||||
@@ -284,7 +284,7 @@ int GPTDataCurses::DisplayParts(int selected) {
|
||||
} else {
|
||||
currentSpace = ShowSpace(i, lineNum);
|
||||
move(lineNum++, 0);
|
||||
- printw(">");
|
||||
+ printw("%s",">");
|
||||
}
|
||||
DisplayOptions(i);
|
||||
retval = selected;
|
||||
@@ -632,7 +632,7 @@ void GPTDataCurses::DisplayOptions(char selectedKey) {
|
||||
} // if/else
|
||||
} // for
|
||||
move(LINES - 1, (COLS - optionDesc.length()) / 2);
|
||||
- printw(optionDesc.c_str());
|
||||
+ printw("%s",optionDesc.c_str());
|
||||
currentKey = selectedKey;
|
||||
} // if
|
||||
} // GPTDataCurses::DisplayOptions()
|
||||
@@ -744,11 +744,11 @@ void GPTDataCurses::DrawMenu(void) {
|
||||
|
||||
clear();
|
||||
move(0, (COLS - title.length()) / 2);
|
||||
- printw(title.c_str());
|
||||
+ printw("%s",title.c_str());
|
||||
move(2, (COLS - drive.length()) / 2);
|
||||
- printw(drive.c_str());
|
||||
+ printw("%s",drive.c_str());
|
||||
move(3, (COLS - size.str().length()) / 2);
|
||||
- printw(size.str().c_str());
|
||||
+ printw("%s",size.str().c_str());
|
||||
DisplayParts(currentSpaceNum);
|
||||
} // DrawMenu
|
||||
|
||||
@@ -798,7 +798,7 @@ void PromptToContinue(void) {
|
||||
void Report(string theText) {
|
||||
clear();
|
||||
move(0, 0);
|
||||
- printw(theText.c_str());
|
||||
+ printw("%s", theText.c_str());
|
||||
move(LINES - 2, (COLS - 29) / 2);
|
||||
printw("Press any key to continue....");
|
||||
cbreak();
|
||||
@@ -9,6 +9,7 @@ DEPENDS = "util-linux"
|
||||
|
||||
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz \
|
||||
file://0001-gptcurses-correctly-include-curses.h.patch \
|
||||
file://0001-gptcurses-correct-ncurses-6.3-errors.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "95d19856f004dabc4b8c342b2612e8d0a9eebdd52004297188369f152e9dc6df"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user