From: rossb Date: Wed, 23 Dec 2009 05:35:08 +0000 (+0000) Subject: made buffer in PaUtil_DebugPrint local rather than static to avoid multithreaded... X-Git-Tag: pa_stable_v19_20110326_r1647~191 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=6bd9c2fd1a63b12948233272a08c5a73cd3937fe;p=portaudio made buffer in PaUtil_DebugPrint local rather than static to avoid multithreaded issues --- diff --git a/src/common/pa_debugprint.c b/src/common/pa_debugprint.c index a878028..f05f40e 100644 --- a/src/common/pa_debugprint.c +++ b/src/common/pa_debugprint.c @@ -85,16 +85,18 @@ void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb) #define SIZEDUMP 1024 -static char strdump[SIZEDUMP]; void PaUtil_DebugPrint( const char *format, ... ) { if (userCB) { + char strdump[SIZEDUMP]; + va_list ap; va_start( ap, format ); VSNPRINTF( strdump, SIZEDUMP, format, ap ); + strdump[SIZEDUMP-1] = 0; userCB(strdump); va_end( ap ); }