mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
librpc: Make NDR_PRINT_DEBUG call just one DEBUG
Give debug.c the chance to use just one write call (right now it doesn't yet) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
b565901a47
commit
a32f52e573
@ -439,12 +439,15 @@ _PUBLIC_ bool ndr_print_debug(int level,
|
||||
const char *function)
|
||||
{
|
||||
struct ndr_print *ndr;
|
||||
|
||||
DEBUGLF(level, (" "), location, function);
|
||||
bool ret = false;
|
||||
|
||||
ndr = talloc_zero(NULL, struct ndr_print);
|
||||
if (!ndr) return false;
|
||||
ndr->print = ndr_print_debug_helper;
|
||||
ndr->private_data = talloc_strdup(ndr, "");
|
||||
if (ndr->private_data == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
ndr->print = ndr_print_string_helper;
|
||||
ndr->depth = 1;
|
||||
ndr->flags = 0;
|
||||
#ifdef DEBUG_PASSWORD
|
||||
@ -454,8 +457,12 @@ _PUBLIC_ bool ndr_print_debug(int level,
|
||||
#endif
|
||||
|
||||
fn(ndr, name, ptr);
|
||||
DEBUGLF(level, (" %s", (char *)ndr->private_data), location, function);
|
||||
|
||||
ret = true;
|
||||
fail:
|
||||
talloc_free(ndr);
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user