mirror of
https://github.com/reactos/reactos.git
synced 2025-07-02 22:21:22 +00:00
- Get rid of sprintf usage in default_dbg_vprintf.
- This make tracing macro usage safe in crt sprintf implementation and simplify overall codepath (no need for intermediate buffer). - Solution inspired by hackbunny's suggestion, fixes bug 3632. See issue #3632 for more details. svn path=/trunk/; revision=35131
This commit is contained in:
parent
305fa7aff9
commit
b86b32b0c4
1 changed files with 11 additions and 4 deletions
15
reactos/lib/3rdparty/libwine/debug.c
vendored
15
reactos/lib/3rdparty/libwine/debug.c
vendored
|
@ -42,6 +42,16 @@ DbgPrint(
|
|||
IN ...
|
||||
);
|
||||
|
||||
ULONG
|
||||
__cdecl
|
||||
vDbgPrintExWithPrefix(
|
||||
IN LPCSTR Prefix,
|
||||
IN ULONG ComponentId,
|
||||
IN ULONG Level,
|
||||
IN LPCSTR Format,
|
||||
IN va_list ap);
|
||||
|
||||
|
||||
static const char * const debug_classes[] = { "fixme", "err", "warn", "trace" };
|
||||
|
||||
#define MAX_DEBUG_OPTIONS 256
|
||||
|
@ -384,10 +394,7 @@ static const char *default_dbgstr_wn( const WCHAR *str, int n )
|
|||
/* default implementation of wine_dbg_vprintf */
|
||||
static int default_dbg_vprintf( const char *format, va_list args )
|
||||
{
|
||||
char buffer[512];
|
||||
vsnprintf( buffer, sizeof(buffer), format, args );
|
||||
buffer[sizeof(buffer) - 1] = '\0';
|
||||
return DbgPrint( "%s", buffer );
|
||||
return vDbgPrintExWithPrefix(NULL, -1, 0, format, args);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue