summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-12-14 05:17:46 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-12-14 05:17:46 +0000
commit0dad72fbe7b543626df4b8f7375e7a5dcd75dbab (patch)
tree06894d4383cc2901399009f6bcfe3fe488ec1cf4 /usr.bin/mandoc/main.c
parent78c82be206fa261447f9d97f21f44e9e4e4e8bc5 (diff)
Almost mechanical diff to remove the "struct mparse *" argument
from mandoc_msg(), where it is no longer used. While here, rename mandoc_vmsg() to mandoc_msg() and retire the old version: There is really no point in having another function merely to save "%s" in a few places. Minus 140 lines of code.
Diffstat (limited to 'usr.bin/mandoc/main.c')
-rw-r--r--usr.bin/mandoc/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 66f677de825..8fd47eb38f7 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.215 2018/12/14 01:17:46 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.216 2018/12/14 05:17:45 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -859,7 +859,6 @@ check_xr(void)
static struct manpaths paths;
struct mansearch search;
struct mandoc_xr *xr;
- char *cp;
size_t sz;
if (paths.sz == 0)
@@ -878,12 +877,12 @@ check_xr(void)
if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz))
continue;
if (xr->count == 1)
- mandoc_asprintf(&cp, "Xr %s %s", xr->name, xr->sec);
+ mandoc_msg(MANDOCERR_XR_BAD, xr->line,
+ xr->pos + 1, "Xr %s %s", xr->name, xr->sec);
else
- mandoc_asprintf(&cp, "Xr %s %s (%d times)",
+ mandoc_msg(MANDOCERR_XR_BAD, xr->line,
+ xr->pos + 1, "Xr %s %s (%d times)",
xr->name, xr->sec, xr->count);
- mandoc_msg(MANDOCERR_XR_BAD, NULL, xr->line, xr->pos + 1, cp);
- free(cp);
}
}