aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tbl_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-31 00:12:41 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-31 00:12:41 +0000
commit4ac6265c00a615f1c73a9e93009e46865afcdfd9 (patch)
tree84bf9628732ac7eeef73923d3f6f0f0f66bbc5ce /tbl_term.c
parent6c75cc18099b6c7db33c10df54276a2baeb97ae3 (diff)
downloadmandoc-4ac6265c00a615f1c73a9e93009e46865afcdfd9.tar.gz
mandoc-4ac6265c00a615f1c73a9e93009e46865afcdfd9.tar.zst
mandoc-4ac6265c00a615f1c73a9e93009e46865afcdfd9.zip
Use relative offsets instead of absolute pointers for the terminal
font stack. The latter fail after the stack is grown with realloc(). Fixing an assertion failure found by jsg@ with afl some time ago (test case number 51).
Diffstat (limited to 'tbl_term.c')
-rw-r--r--tbl_term.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tbl_term.c b/tbl_term.c
index 455a158d..a6354b51 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_term.c,v 1.37 2015/01/30 17:32:16 schwarze Exp $ */
+/* $Id: tbl_term.c,v 1.38 2015/01/31 00:12:41 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -414,9 +414,9 @@ tbl_number(struct termp *tp, const struct tbl_opts *opts,
static void
tbl_word(struct termp *tp, const struct tbl_dat *dp)
{
- const void *prev_font;
+ int prev_font;
- prev_font = term_fontq(tp);
+ prev_font = tp->fonti;
if (dp->layout->flags & TBL_CELL_BOLD)
term_fontpush(tp, TERMFONT_BOLD);
else if (dp->layout->flags & TBL_CELL_ITALIC)