From cf854caa9b62c0c1ad88f29e7a69886e79c08c91 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 21 Jan 2017 11:22:44 +0100 Subject: diag_msg: Don't replace second character of every msg with 'p' We want to replace all %s with %p, but not modify other parts of the format string... --- src/diag_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diag_msg.c b/src/diag_msg.c index e96ad7a..20eca83 100644 --- a/src/diag_msg.c +++ b/src/diag_msg.c @@ -102,7 +102,7 @@ static void diag_rx_ext_msg_f(struct diag_instance *di, struct msgb *msgb) file, osmo_load16le(&msg->line_nr)); /* replace all '%s' with '%p', as %s obviously doesn't work */ - for (char *cur = fmt; cur && (cur < fmt + strlen(fmt)); cur = strstr(fmt, "%s")) { + for (char *cur = strstr(fmt, "%s"); cur && (cur < fmt + strlen(fmt)); cur = strstr(fmt, "%s")) { cur[1] = 'p'; } -- cgit v1.2.3