diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-08 12:40:27 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-08 12:40:27 +0000 |
commit | 74e270cb031a950090a2f9a9c1a083e2c45ebb6a (patch) | |
tree | 9227d21db7c9d0ba4e9a907977f4ceb68a7f546f /action.c | |
parent | ca7eb2795830f918afc855b2fdaabe093d8cee13 (diff) | |
download | mandoc-74e270cb031a950090a2f9a9c1a083e2c45ebb6a.tar.gz |
Memory fixes in new dynamic schema.
Diffstat (limited to 'action.c')
-rw-r--r-- | action.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -514,7 +514,7 @@ post_bl_width(struct mdoc *m) size_t width; int i, tok; char buf[32]; - char **p; + char *p; if (NULL == m->last->args) return(merr(m, ENOWIDTH)); @@ -526,29 +526,29 @@ post_bl_width(struct mdoc *m) if (i == (int)m->last->args->argc) return(merr(m, ENOWIDTH)); - p = &m->last->args->argv[i].value[0]; + p = m->last->args->argv[i].value[0]; /* * If the value to -width is a macro, then we re-write it to be * the macro's width as set in share/tmac/mdoc/doc-common. */ - if (xstrcmp(*p, "Ds")) + if (xstrcmp(p, "Ds")) width = 8; - else if (MDOC_MAX == (tok = mdoc_tokhash_find(m->htab, *p))) + else if (MDOC_MAX == (tok = mdoc_tokhash_find(m->htab, p))) return(1); else if (0 == (width = mdoc_macro2len(tok))) return(mwarn(m, WNOWIDTH)); mdoc_msg(m, "re-writing %s argument: %s -> %zun", - mdoc_argnames[MDOC_Width], *p, width); + mdoc_argnames[MDOC_Width], p, width); /* The value already exists: free and reallocate it. */ (void)snprintf(buf, sizeof(buf), "%zun", width); - free(*p); - *p = xstrdup(buf); + free(m->last->args->argv[i].value[0]); + m->last->args->argv[i].value[0] = xstrdup(buf); return(1); } |