From 4ae27891f8ac0a56d68b0544e78d6c17ade0c1c9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Oct 2010 15:56:29 +1100 Subject: 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 Autobuild-Date: Tue Nov 2 00:18:43 UTC 2010 on sn-devel-104 --- lib/util/debug.c | 6 +----- 1 file changed, 1 insertion(+), 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; -- cgit