sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit bfc62285347fc4c7bc0f6f241089a2fed1aad961
parent 37f90cefd6693ba163cecbbb49edd6f219e202b2
Author: FRIGN <dev@frign.de>
Date:   Mon Dec 21 13:57:10 +0100

Check argv0 in xvprintf()

You never know, given printf'ing NULL-strings might crash the
program, we shouldn't just pass argv0 blindly to it.

Diffstat:
libutil/eprintf.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libutil/eprintf.c b/libutil/eprintf.c @@ -47,7 +47,7 @@ weprintf(const char *fmt, ...) void xvprintf(const char *fmt, va_list ap) { - if (strncmp(fmt, "usage", strlen("usage"))) + if (argv0 && strncmp(fmt, "usage", strlen("usage"))) fprintf(stderr, "%s: ", argv0); vfprintf(stderr, fmt, ap);