mirror of
https://github.com/reactos/reactos.git
synced 2025-07-12 19:04:14 +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. - Add vDbgPrintExWithPrefix to debugsup libraries. See issue #3632 for more details. svn path=/trunk/; revision=36323
This commit is contained in:
parent
b4572ba562
commit
f1c91f140d
2 changed files with 10 additions and 9 deletions
18
reactos/lib/3rdparty/libwine/debug.c
vendored
18
reactos/lib/3rdparty/libwine/debug.c
vendored
|
@ -36,11 +36,14 @@
|
||||||
#include <cmfuncs.h>
|
#include <cmfuncs.h>
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
__cdecl
|
NTAPI
|
||||||
DbgPrint(
|
vDbgPrintExWithPrefix(
|
||||||
IN PCCH Format,
|
IN LPCSTR Prefix,
|
||||||
IN ...
|
IN ULONG ComponentId,
|
||||||
);
|
IN ULONG Level,
|
||||||
|
IN LPCSTR Format,
|
||||||
|
IN va_list ap);
|
||||||
|
|
||||||
|
|
||||||
static const char * const debug_classes[] = { "fixme", "err", "warn", "trace" };
|
static const char * const debug_classes[] = { "fixme", "err", "warn", "trace" };
|
||||||
|
|
||||||
|
@ -387,10 +390,7 @@ static const char *default_dbgstr_wn( const WCHAR *str, int n )
|
||||||
/* default implementation of wine_dbg_vprintf */
|
/* default implementation of wine_dbg_vprintf */
|
||||||
static int default_dbg_vprintf( const char *format, va_list args )
|
static int default_dbg_vprintf( const char *format, va_list args )
|
||||||
{
|
{
|
||||||
char buffer[512];
|
return vDbgPrintExWithPrefix("", -1, 0, format, args);
|
||||||
vsnprintf( buffer, sizeof(buffer), format, args );
|
|
||||||
buffer[sizeof(buffer) - 1] = '\0';
|
|
||||||
return DbgPrint( "%s", buffer );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ DbgBreakPointWithStatus@4
|
||||||
DbgPrint
|
DbgPrint
|
||||||
DbgPrompt@12
|
DbgPrompt@12
|
||||||
DbgPrintEx
|
DbgPrintEx
|
||||||
|
vDbgPrintExWithPrefix@20
|
||||||
RtlAssert@16
|
RtlAssert@16
|
||||||
RtlUnwind@16
|
RtlUnwind@16
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue