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.
This commit is contained in:
parent
3b1b50cffa
commit
e40fc2b176
|
@ -47,7 +47,7 @@ weprintf(const char *fmt, ...)
|
||||||
void
|
void
|
||||||
xvprintf(const char *fmt, va_list ap)
|
xvprintf(const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
if (strncmp(fmt, "usage", strlen("usage")))
|
if (argv0 && strncmp(fmt, "usage", strlen("usage")))
|
||||||
fprintf(stderr, "%s: ", argv0);
|
fprintf(stderr, "%s: ", argv0);
|
||||||
|
|
||||||
vfprintf(stderr, fmt, ap);
|
vfprintf(stderr, fmt, ap);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user