logging: avoid buffer overrun extracting arguments

The number of arguments for a format string is approximated by the
number of conversion specifications.  This count may exceed the maximum
supported argument count.  Limit the extraction to the available space.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
1 file changed