diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-01-19 22:48:16 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-01-19 22:48:16 +0000 |
commit | 47affe011d1514ddca9022d23c41966cfbfc705e (patch) | |
tree | bee0562d1e6586fd0964df4d826625c632cdaf89 | |
parent | 43727b4bbceedf30ea82c4c1185c54b5ddfc15c2 (diff) | |
download | mandoc-47affe011d1514ddca9022d23c41966cfbfc705e.tar.gz |
Avoid the risk of trying to modify a literal string.
-rw-r--r-- | mandocdb.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); } |