summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c7
-rw-r--r--read.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/main.c b/main.c
index c6c92386..73ab9e81 100644
--- a/main.c
+++ b/main.c
@@ -411,14 +411,17 @@ static void
mmsg(enum mandocerr t, enum mandoclevel lvl,
const char *file, int line, int col, const char *msg)
{
+ const char *mparse_msg;
fprintf(stderr, "%s: %s:", progname, file);
if (line)
fprintf(stderr, "%d:%d:", line, col + 1);
- fprintf(stderr, " %s: %s", mparse_strlevel(lvl),
- mparse_strerror(t));
+ fprintf(stderr, " %s", mparse_strlevel(lvl));
+
+ if (NULL != (mparse_msg = mparse_strerror(t)))
+ fprintf(stderr, ": %s", mparse_msg);
if (msg)
fprintf(stderr, ": %s", msg);
diff --git a/read.c b/read.c
index 965d354e..3b6242cf 100644
--- a/read.c
+++ b/read.c
@@ -210,7 +210,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"static buffer exhausted",
/* system errors */
- "cannot open file",
+ NULL,
"cannot stat file",
"cannot read file",
};