sbase

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

commit e40fc2b17676145087f62e66940d8aceccb793b5
parent 3b1b50cffa67f8411e54aa5d1d57a20975a656be
Author: FRIGN <dev@frign.de>
Date:   Mon, 21 Dec 2015 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:
Mlibutil/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);