Skip to content

Commit cb4d8cc

Browse files
committed
liboping: fix compilation with ncurses 6.3
Fix compilation with ncurses 6.3 by adjusting the printf format strings. Apparently ncurses 6.3 introduced some new formatting tweaks that broke things. Fixes openwrt#18110 Reference to: * octo/liboping#62 * octo/liboping#61 * https://salsa.debian.org/debian/liboping/-/blob/debian/debian/patches/fix_HOST_PRINTF_format_string.patch Signed-off-by: Hannu Nyman <[email protected]>
1 parent 546af52 commit cb4d8cc

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

libs/liboping/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=liboping
1111
PKG_VERSION:=1.10.0
12-
PKG_RELEASE:=2
12+
PKG_RELEASE:=$(AUTORELEASE)
1313
PKG_MAINTAINER:=Jo-Philipp Wich <[email protected]>
1414
PKG_LICENSE:=LGPL-2.1-or-later
1515

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--- a/src/oping.c
2+
+++ b/src/oping.c
3+
@@ -1125,7 +1125,7 @@ static int update_graph_prettyping (ping
4+
wattron (ctx->window, COLOR_PAIR(color));
5+
6+
if (has_utf8())
7+
- mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, symbol);
8+
+ mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, "%s", symbol);
9+
else
10+
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, symbolc);
11+
12+
@@ -1223,7 +1223,7 @@ static int update_graph_histogram (ping_
13+
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, ' ');
14+
else if (has_utf8 ())
15+
mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2,
16+
- hist_symbols_utf8[index]);
17+
+ "%s", hist_symbols_utf8[index]);
18+
else
19+
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2,
20+
hist_symbols_acs[index] | A_ALTCHARSET);
21+
@@ -1600,8 +1600,7 @@ static void update_host_hook (pingobj_it
22+
23+
HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
24+
data_len, context->host, context->addr,
25+
- sequence, recv_ttl,
26+
- format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
27+
+ sequence, recv_ttl);
28+
if ((recv_qos != 0) || (opt_send_qos != 0))
29+
{
30+
HOST_PRINTF ("qos=%s ",

0 commit comments

Comments
 (0)