diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-09 15:09:27 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-09 15:09:27 +0000 |
commit | 6737b893e3198eb8acb1647742d46a6c58cf3c30 (patch) | |
tree | bc571e3a78d753c09bfcc10f76add86d4682d542 /main.c | |
parent | 83a44904f7c78e291160d641ce52aff6713689bf (diff) | |
download | mandoc-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |