summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-08 12:40:27 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-08 12:40:27 +0000
commit74e270cb031a950090a2f9a9c1a083e2c45ebb6a (patch)
tree9227d21db7c9d0ba4e9a907977f4ceb68a7f546f /action.c
parentca7eb2795830f918afc855b2fdaabe093d8cee13 (diff)
downloadmandoc-74e270cb031a950090a2f9a9c1a083e2c45ebb6a.tar.gz
Memory fixes in new dynamic schema.
Diffstat (limited to 'action.c')
-rw-r--r--action.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/action.c b/action.c
index f1224c1d..02c71b53 100644
--- a/action.c
+++ b/action.c
@@ -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);
}