From: Karel Zak Date: Mon, 10 Mar 2014 10:57:26 +0000 (+0100) Subject: cfdisk: update table index when out of range X-Git-Tag: v2.25-rc1~453 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b230117970b332138493932c7f4a3da70118c807;p=thirdparty%2Futil-linux.git cfdisk: update table index when out of range Signed-off-by: Karel Zak --- diff --git a/fdisks/cfdisk.c b/fdisks/cfdisk.c index 7865578f1c..0fd64bf61b 100644 --- a/fdisks/cfdisk.c +++ b/fdisks/cfdisk.c @@ -1052,6 +1052,9 @@ static int ui_draw_table(struct cfdisk *cf) clrtoeol(); } + if ((size_t) cf->lines_idx > nparts - 1) + cf->lines_idx = nparts ? nparts - 1 : 0; + /* print header */ attron(A_BOLD); mvaddstr(TABLE_START_LINE, cl, cf->lines[0]);