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...
This commit is contained in:
Harald Welte 2017-01-21 11:22:44 +01:00
parent 70ff72d5f4
commit cf854caa9b
1 changed files with 1 additions and 1 deletions

View File

@ -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';
}