summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-01-19 22:48:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-01-19 22:48:16 +0000
commit47affe011d1514ddca9022d23c41966cfbfc705e (patch)
treebee0562d1e6586fd0964df4d826625c632cdaf89
parent43727b4bbceedf30ea82c4c1185c54b5ddfc15c2 (diff)
downloadmandoc-47affe011d1514ddca9022d23c41966cfbfc705e.tar.gz
Avoid the risk of trying to modify a literal string.
-rw-r--r--mandocdb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 180bc928..8be546b3 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -956,6 +956,7 @@ mlink_check(struct mpage *mpage, struct mlink *mlink)
static void
mpages_merge(struct mchars *mc, struct mparse *mp)
{
+ char any[] = "any";
struct ohash_info str_info;
struct mpage *mpage;
struct mlink *mlink;
@@ -1027,7 +1028,7 @@ mpages_merge(struct mchars *mc, struct mparse *mp)
}
putkey(mpage, mpage->sec, TYPE_sec);
putkey(mpage, '\0' == *mpage->arch ?
- "any" : mpage->arch, TYPE_arch);
+ any : mpage->arch, TYPE_arch);
for (mlink = mpage->mlinks; mlink; mlink = mlink->next) {
if ('\0' != *mlink->dsec)
@@ -1035,7 +1036,7 @@ mpages_merge(struct mchars *mc, struct mparse *mp)
if ('\0' != *mlink->fsec)
putkey(mpage, mlink->fsec, TYPE_sec);
putkey(mpage, '\0' == *mlink->arch ?
- "any" : mlink->arch, TYPE_arch);
+ any : mlink->arch, TYPE_arch);
putkey(mpage, mlink->name, TYPE_Nm);
}