summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2012-06-08 12:05:27 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2012-06-08 12:05:27 +0000
commit8327fffa25291462a5a1f4677f0a33e9262217c0 (patch)
tree8f18c85dba32c6a60c030036eda2b3ccbc5e65ce
parentc5ab96fef3857d6878d16856c0d7bc3907a93a6e (diff)
downloadmandoc-8327fffa25291462a5a1f4677f0a33e9262217c0.tar.gz
Use C99 syntax for declaring the string-hash key array.
-rw-r--r--mandocdb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 1a9182fa..ba156361 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -79,7 +79,7 @@ struct str {
const struct of *of; /* if set, the owning parse */
struct str *next; /* next in owning parse sequence */
uint64_t mask; /* bitmask in sequence */
- char key[1]; /* the string itself */
+ char key[]; /* the string itself */
};
struct id {
@@ -1538,7 +1538,7 @@ straddbuf(const char *cp, size_t sz)
if (NULL != (s = hashget(cp, sz)))
return(s->key);
- s = mandoc_calloc(sizeof(struct str) + sz, 1);
+ s = mandoc_calloc(sizeof(struct str) + sz + 1, 1);
memcpy(s->key, cp, sz);
end = cp + sz;
@@ -1585,7 +1585,7 @@ wordaddbuf(const struct of *of,
s->mask |= v;
return;
} else if (NULL == s) {
- s = mandoc_calloc(sizeof(struct str) + sz, 1);
+ s = mandoc_calloc(sizeof(struct str) + sz + 1, 1);
memcpy(s->key, cp, sz);
end = cp + sz;
index = ohash_qlookupi(&strings, cp, &end);