From: Stef Walter Date: Tue, 27 Aug 2013 18:52:35 +0000 (+0200) Subject: debug: Allow debug lines longer than 512 characters X-Git-Tag: 0.20.0~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f6fd42ea33e09687487e8981e02080c8a6c7b40;p=p11-kit debug: Allow debug lines longer than 512 characters Since fprintf (stderr, ...) already doesn't print atomically, we don't lose any atomicity here. If we want to print atomically this will need some further reworking anyway. --- diff --git a/common/debug.c b/common/debug.c index 178b6c5..b3327be 100644 --- a/common/debug.c +++ b/common/debug.c @@ -126,15 +126,14 @@ void p11_debug_message (int flag, const char *format, ...) { - char buffer[512]; va_list args; if (flag & p11_debug_current_flags) { + fprintf (stderr, "(p11-kit:%d) ", getpid()); va_start (args, format); - vsnprintf (buffer, sizeof (buffer), format, args); - buffer[sizeof (buffer) -1] = 0; + vfprintf (stderr, format, args); va_end (args); - fprintf (stderr, "(p11-kit:%d) %s\n", getpid(), buffer); + fprintf (stderr, "\n"); } }