summaryrefslogtreecommitdiffstatshomepage
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
commit1969953cea0d27525c0c0b227d2021bd99952969 (patch)
tree214a5fda9483317024a70880bf3255df5594593b /action.c
parentd53f3eea978ab62538513a30e29ca8c1da6f9c45 (diff)
downloadmandoc-1969953cea0d27525c0c0b227d2021bd99952969.tar.gz
mandoc-1969953cea0d27525c0c0b227d2021bd99952969.tar.zst
mandoc-1969953cea0d27525c0c0b227d2021bd99952969.zip
Memory fixes in new dynamic schema.
Diffstat (limited to 'action.c')
-rw-r--r--action.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/action.c b/action.c
index a54aec87..62031368 100644
--- a/action.c
+++ b/action.c
@@ -1,4 +1,4 @@
-/* $Id: action.c,v 1.33 2009/03/08 11:41:22 kristaps Exp $ */
+/* $Id: action.c,v 1.34 2009/03/08 12:40:27 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);
}