Remove DEBUG-define for eprintf.c
Prepend program name only when fmt doesn't begin with "usage".
This commit is contained in:
parent
0c470f5563
commit
3eee8e1509
@ -11,6 +11,6 @@ AR = ar
|
|||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
|
|
||||||
# For NetBSD add -D_NETBSD_SOURCE
|
# For NetBSD add -D_NETBSD_SOURCE
|
||||||
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -DDEBUG
|
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700
|
||||||
CFLAGS = -std=c99 -Wall -pedantic
|
CFLAGS = -std=c99 -Wall -pedantic
|
||||||
LDFLAGS = -s # -lrt
|
LDFLAGS = -s # -lrt
|
||||||
|
@ -33,9 +33,8 @@ enprintf(int status, const char *fmt, ...)
|
|||||||
void
|
void
|
||||||
venprintf(int status, const char *fmt, va_list ap)
|
venprintf(int status, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
if (strncmp(fmt, "usage", strlen("usage")))
|
||||||
fprintf(stderr, "%s: ", argv0);
|
fprintf(stderr, "%s: ", argv0);
|
||||||
#endif
|
|
||||||
|
|
||||||
vfprintf(stderr, fmt, ap);
|
vfprintf(stderr, fmt, ap);
|
||||||
|
|
||||||
@ -52,9 +51,8 @@ weprintf(const char *fmt, ...)
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
#ifdef DEBUG
|
if (strncmp(fmt, "usage", strlen("usage")))
|
||||||
fprintf(stderr, "%s: ", argv0);
|
fprintf(stderr, "%s: ", argv0);
|
||||||
#endif
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vfprintf(stderr, fmt, ap);
|
vfprintf(stderr, fmt, ap);
|
||||||
|
Loading…
Reference in New Issue
Block a user