aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-08-09 15:09:27 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-08-09 15:09:27 +0000
commit6737b893e3198eb8acb1647742d46a6c58cf3c30 (patch)
treebc571e3a78d753c09bfcc10f76add86d4682d542 /main.c
parent83a44904f7c78e291160d641ce52aff6713689bf (diff)
downloadmandoc-6737b893e3198eb8acb1647742d46a6c58cf3c30.tar.gz
mandoc-6737b893e3198eb8acb1647742d46a6c58cf3c30.tar.zst
mandoc-6737b893e3198eb8acb1647742d46a6c58cf3c30.zip
fix printf("%s", NULL);
found while investigating an unrelated bug report from jsg@
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.c b/main.c
index 56bfd635..e240719b 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.274 2016/07/19 21:31:55 schwarze Exp $ */
+/* $Id: main.c,v 1.275 2016/08/09 15:09:27 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -985,7 +985,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);