From: Gaetan Bisson Date: Mon, 28 Feb 2011 13:41:24 +0000 (+0100) Subject: noping: Fix compatibility with ncurses 5.8. X-Git-Tag: liboping-1.6.1~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=79027c304485f5ad5ac5d13da771a8a73e919d59;p=liboping.git noping: Fix compatibility with ncurses 5.8. Hello, My name is Gaetan and I maintain liboping in Arch Linux; our distro is in the process of switching to ncurses-5.8, and I wanted to report that I had to patch liboping to make noping work with the newer ncurses. Specifically, if I update ncurses and run the old noping binary, then nothing is displayed in the ncurses window (although the summary output displayed on stdout at the end is correct). Same if I recompile noping against the new ncurses library. The reason seems to be that calling newwin() with ncols=0 does not produce a full width window anymore. Anyway, the simple patch attached fixed this issue for me. Cheers. Signed-off-by: Florian Forster --- diff --git a/src/oping.c b/src/oping.c index 5ecfdbf..bb75d4e 100644 --- a/src/oping.c +++ b/src/oping.c @@ -673,7 +673,7 @@ static int on_resize (pingobj_t *ping) /* {{{ */ context->window = NULL; } context->window = newwin (/* height = */ 4, - /* width = */ 0, + /* width = */ width, /* y = */ main_win_height + (4 * context->index), /* x = */ 0); } @@ -726,7 +726,7 @@ static int pre_loop_hook (pingobj_t *ping) /* {{{ */ main_win_height = height - (4 * host_num); main_win = newwin (/* height = */ main_win_height, - /* width = */ 0, + /* width = */ width, /* y = */ 0, /* x = */ 0); /* Allow scrolling */ scrollok (main_win, TRUE); @@ -752,7 +752,7 @@ static int pre_loop_hook (pingobj_t *ping) /* {{{ */ context->window = NULL; } context->window = newwin (/* height = */ 4, - /* width = */ 0, + /* width = */ width, /* y = */ main_win_height + (4 * context->index), /* x = */ 0); }