summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-08-06 16:07:35 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-08-06 16:07:35 +0000
commit5703727c0c5b5917be3a184486e2073f77c71a25 (patch)
treea9702556e34b18313e10f2b9aa7b8a6adc1837ae
parente95ebabedd29bfd2dd5f6f0ec793360d68f4b628 (diff)
downloadmandoc-5703727c0c5b5917be3a184486e2073f77c71a25.tar.gz
IMPORTANT FIX: add missing braces around alloc failure conditional in
fuction-isation of PS_GROWBUF. Obviously the original commit was never actually tested, as -Tps and -Tpdf errored out immediately.
-rw-r--r--term_ps.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/term_ps.c b/term_ps.c
index 51d473cb..fb520d17 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -362,13 +362,17 @@ ps_growbuf(struct termp *p, size_t sz)
if (sz < PS_BUFSLOP)
sz = PS_BUFSLOP;
+
p->engine.ps.psmargsz += sz;
- p->engine.ps.psmarg = realloc(p->engine.ps.psmarg,
- p->engine.ps.psmargsz);
- if (NULL == p->engine.ps.psmarg)
+ p->engine.ps.psmarg = realloc
+ (p->engine.ps.psmarg,
+ p->engine.ps.psmargsz);
+
+ if (NULL == p->engine.ps.psmarg) {
perror(NULL);
exit(EXIT_FAILURE);
+ }
}
static double ps_hspan(const struct termp *,