PelionIoT / mbed-trace

mbed trace library
Apache License 2.0
18 stars 15 forks source link

Fix #34: Do not try to use a va_list twice #35

Closed kjbracey closed 8 years ago

kjbracey commented 8 years ago

If the prefix function was set, mbed_vtracef would pass ap to vsnprintf to determine the output length, then use ap again for the actual output, running off the real arguments.

Create a copy of ap for the initial scan. (Thank you to C99, who added va_copy. Would have been stuck without it.)

jupe commented 8 years ago

missing test :)

yogpan01 commented 8 years ago

Verified with mbed-client-testapp on Linux , works fine +1

jupe commented 8 years ago

thanks :)

kjbracey commented 8 years ago

Expanded the existing prefix function test to take 2 arguments.