summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-16 15:58:50 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-16 15:58:50 +0000
commit50c7e68a675c2b7d573e94e93564b37785d2cad6 (patch)
tree11e1cf0f02ae887d2f5cafa23e29d58e04a3d5d9 /mdoc.c
parent74e24071f684da83ad181e5fec715d15f5f4dfae (diff)
downloadmandoc-50c7e68a675c2b7d573e94e93564b37785d2cad6.tar.gz
Initial separation of tree/mdocml.1.
Finished mdoc.3. Broken build: mdocml.c.
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mdoc.c b/mdoc.c
index e51f7771..783ea1a2 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -241,7 +241,8 @@ mdoc_alloc(void *data, const struct mdoc_cb *cb)
p = xcalloc(1, sizeof(struct mdoc));
p->data = data;
- (void)memcpy(&p->cb, cb, sizeof(struct mdoc_cb));
+ if (cb)
+ (void)memcpy(&p->cb, cb, sizeof(struct mdoc_cb));
p->last = xcalloc(1, sizeof(struct mdoc_node));
p->last->type = MDOC_ROOT;