commit 24a5006f57193bc6f65e21eff3cd4ab3122114c1
parent 897efd5f13ebecf8d29a9c51df1ec87e6e9d2863
Author: sin <sin@2f30.org>
Date: Fri, 28 Mar 2014 15:55:08 +0000
Prefix error/warning messages with program name if DEBUG is defined
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/util/eprintf.c b/util/eprintf.c
@@ -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);
@@ -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);