summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-10-29 15:56:29 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-11-02 00:18:43 +0000
commit4ae27891f8ac0a56d68b0544e78d6c17ade0c1c9 (patch)
treecb2269984509936390101eacebedb8e17c8f149c /lib
parentad7b551edc75ffb7233f5eafdd3680c2c20eef92 (diff)
downloadsamba-4ae27891f8ac0a56d68b0544e78d6c17ade0c1c9.tar.gz
samba-4ae27891f8ac0a56d68b0544e78d6c17ade0c1c9.tar.bz2
samba-4ae27891f8ac0a56d68b0544e78d6c17ade0c1c9.zip
lib/debug Use vdprintf rather than manually allocate
This allows the system to use whatever buffers it wants for the string rather than assuming we need to malloc() it. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Nov 2 00:18:43 UTC 2010 on sn-devel-104
Diffstat (limited to 'lib')
-rw-r--r--lib/util/debug.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 055dfbb12e..5760a709ef 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -118,16 +118,12 @@ _PUBLIC_ void dbghdrclass(int level, int dclass, const char *location, const cha
_PUBLIC_ void dbgtext(const char *format, ...)
{
va_list ap;
- char *s = NULL;
if (!check_reopen_logs()) return;
va_start(ap, format);
- vasprintf(&s, format, ap);
+ vdprintf(state.fd, format, ap);
va_end(ap);
-
- write(state.fd, s, strlen(s));
- free(s);
}
_PUBLIC_ const char *logfile = NULL;