mirror of https://gerrit.osmocom.org/libosmocore
fix against corrupted output in parallel logging
In 8256076722
it was attempted to fix
a bug previously introduced by logging related changes. The problem
is that a va_list can be corrupted after it has been used once, so
we need to va_copy before each successive use.
And if we copy it, we also need to use the copy, and not the original ;)
This commit is contained in:
parent
8264e09ca2
commit
da127cbb3e
|
@ -261,7 +261,7 @@ static void _logp(int subsys, int level, char *file, int line,
|
|||
* in undefined state. Since _output uses vsnprintf and it may
|
||||
* be called several times, we have to pass a copy of ap. */
|
||||
va_copy(bp, ap);
|
||||
_output(tar, subsys, level, file, line, cont, format, ap);
|
||||
_output(tar, subsys, level, file, line, cont, format, bp);
|
||||
va_end(bp);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue