[hackers] [sbase] Prefix error/warning messages with program name if DEBUG is defined || sin

From: <git_AT_suckless.org>
Date: Fri, 28 Mar 2014 17:00:05 +0100

commit 24a5006f57193bc6f65e21eff3cd4ab3122114c1
Author: sin <sin_AT_2f30.org>
Date: Fri Mar 28 15:55:08 2014 +0000

    Prefix error/warning messages with program name if DEBUG is defined

diff --git a/util/eprintf.c b/util/eprintf.c
index bd4e090..91b19b7 100644
--- a/util/eprintf.c
+++ b/util/eprintf.c
_AT_@ -33,7 +33,9 @@ enprintf(int status, const char *fmt, ...)
 void
 venprintf(int status, const char *fmt, va_list ap)
 {
+#ifdef DEBUG
         fprintf(stderr, "%s: ", argv0);
+#endif
 
         vfprintf(stderr, fmt, ap);
 
_AT_@ -50,7 +52,9 @@ weprintf(const char *fmt, ...)
 {
         va_list ap;
 
+#ifdef DEBUG
         fprintf(stderr, "%s: ", argv0);
+#endif
 
         va_start(ap, fmt);
         vfprintf(stderr, fmt, ap);
Received on Fri Mar 28 2014 - 17:00:05 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 28 2014 - 17:12:07 CET