summaryrefslogtreecommitdiff
path: root/bin/ksh/io.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-09-22 21:50:41 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-09-22 21:50:41 +0000
commit6e60e48fdd8022a4da2ecad0a4ec8d65e4110a78 (patch)
tree1e58923afa2769e6618902b49259071569574487 /bin/ksh/io.c
parentdac08daa66a37497220033a0013fe7c86ebe3cee (diff)
Make errorf() and bi_errorf() handle a NULL argument.
From Michael McConville; OK nicm@
Diffstat (limited to 'bin/ksh/io.c')
-rw-r--r--bin/ksh/io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ksh/io.c b/bin/ksh/io.c
index 613e5dc576a..736b0857826 100644
--- a/bin/ksh/io.c
+++ b/bin/ksh/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.29 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: io.c,v 1.30 2015/09/22 21:50:40 millert Exp $ */
/*
* shell buffered IO and formatted output
@@ -23,7 +23,7 @@ errorf(const char *fmt, ...)
shl_stdout_ok = 0; /* debugging: note that stdout not valid */
exstat = 1;
- if (*fmt) {
+ if (fmt != NULL && *fmt != '\0') {
error_prefix(true);
va_start(va, fmt);
shf_vfprintf(shl_out, fmt, va);
@@ -58,7 +58,7 @@ bi_errorf(const char *fmt, ...)
shl_stdout_ok = 0; /* debugging: note that stdout not valid */
exstat = 1;
- if (*fmt) {
+ if (fmt != NULL && *fmt != '\0') {
error_prefix(true);
/* not set when main() calls parse_args() */
if (builtin_argv0)