summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2016-08-09 15:08:16 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2016-08-09 15:08:16 +0000
commit367e409ead98402f753f6650813d50c45a6da5d3 (patch)
tree9734914f803b4ed5daf28e25f4ede4407d1084e9 /usr.bin/mandoc/main.c
parentcc4351733ea0d248fb82dc73129e8be6f138a9c7 (diff)
fix printf("%s", NULL);
found while investigating an unrelated bug report from jsg@
Diffstat (limited to 'usr.bin/mandoc/main.c')
-rw-r--r--usr.bin/mandoc/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 45f5c52d9f7..c2208c9d0d8 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.177 2016/08/01 10:32:39 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.178 2016/08/09 15:08:15 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -955,7 +955,8 @@ mmsg(enum mandocerr t, enum mandoclevel lvl,
{
const char *mparse_msg;
- fprintf(stderr, "%s: %s:", getprogname(), file);
+ fprintf(stderr, "%s: %s:", getprogname(),
+ file == NULL ? "<stdin>" : file);
if (line)
fprintf(stderr, "%d:%d:", line, col + 1);