aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-01-21 11:22:44 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-21 11:22:44 +0100
commitcf854caa9b62c0c1ad88f29e7a69886e79c08c91 (patch)
tree623fa333b8eeaef58775c286e4a1c2f40239d101
parent70ff72d5f45a85785280391cf7375eebea6ef31c (diff)
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...
-rw-r--r--src/diag_msg.c2
1 files changed, 1 insertions, 1 deletions
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';
}