1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

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
This commit is contained in:
Andrew Bartlett 2010-10-29 15:56:29 +11:00
parent ad7b551edc
commit 4ae27891f8

View File

@ -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;