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>
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
#endif
fn(ndr, name, ptr);
+ DEBUGLF(level, (" %s", (char *)ndr->private_data), location, function);
+
+ ret = true;
+fail:
talloc_free(ndr);
- return true;
+ return ret;
}
/*