git.iko.soy/typeable/nixpkgs
on master help sign in
liboping: pull pending upstream inclusion fix for ncurses-6.3

Without the fix build on ncurses-6.3 fails as: oping.c:1128:25: error: format not a string literal and no format arguments [-Werror=format-security] 1128 | mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, symbol); | ^~~~~~~~~

commit387b85da72c12f94fb9d9558c1c834a4df6d6f57 authorSergei Trofimovich <slyich@gmail.com> dateSun 28 Nov 2021, 15:52 (5 years ago) parent78cb77b
2 files changed+27
pkgs/development/libraries/liboping/default.nix+6 pkgs/development/libraries/liboping/ncurses-6.3.patch+21
pkgs/development/libraries/liboping/default.nix+6
@@ -9,6 +9,12 @@ stdenv.mkDerivation rec {
99 sha256 = "1n2wkmvw6n80ybdwkjq8ka43z2x8mvxq49byv61b52iyz69slf7b";
1010 };
1111
12+ patches = [
13+ # Add support for ncurses-6.3. A backport of patch pending upstream
14+ # inclusion: https://github.com/octo/liboping/pull/61
15+ ./ncurses-6.3.patch
16+ ];
17+
1218 NIX_CFLAGS_COMPILE = lib.optionalString
1319 stdenv.cc.isGNU "-Wno-error=format-truncation";
1420
pkgs/development/libraries/liboping/ncurses-6.3.patchnew file+21
@@ -0,0 +1,21 @@
1+A backport of https://github.com/octo/liboping/pull/61
2+--- a/src/oping.c
3++++ b/src/oping.c
4+@@ -1125,7 +1125,7 @@ static int update_graph_prettyping (ping_context_t *ctx, /* {{{ */
5+ wattron (ctx->window, COLOR_PAIR(color));
6+
7+ if (has_utf8())
8+- mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, symbol);
9++ mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, "%s", symbol);
10+ else
11+ mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, symbolc);
12+
13+@@ -1222,7 +1222,7 @@ static int update_graph_histogram (ping_context_t *ctx) /* {{{ */
14+ if (counters[x] == 0)
15+ mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, ' ');
16+ else if (has_utf8 ())
17+- mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2,
18++ mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, "%s",
19+ hist_symbols_utf8[index]);
20+ else
21+ mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2,