summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-14 17:54:42 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-14 17:54:42 +0000
commitc6f3075846c286cebabf731303d52660dd30afe8 (patch)
tree7fc3844d639c5d82fd378b30e3461c0fc7f04174 /term.c
parent121fc3d4eff42f9400d7e165b83c068757148a7b (diff)
downloadmandoc-c6f3075846c286cebabf731303d52660dd30afe8.tar.gz
Make character engine (-Tascii, -Tpdf, -Tps) ready for Unicode: make buffer
consist of type "int". This will take more work (especially in encode and friends), but this is a strong start. This commit also consists of some harmless lint fixes.
Diffstat (limited to 'term.c')
-rw-r--r--term.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/term.c b/term.c
index e42dcea7..758e7239 100644
--- a/term.c
+++ b/term.c
@@ -532,7 +532,7 @@ adjbuf(struct termp *p, size_t sz)
while (sz >= p->maxcols)
p->maxcols <<= 2;
- p->buf = mandoc_realloc(p->buf, p->maxcols);
+ p->buf = mandoc_realloc(p->buf, sizeof(int) * p->maxcols);
}
@@ -562,8 +562,8 @@ encode(struct termp *p, const char *word, size_t sz)
if (TERMFONT_NONE == (f = term_fonttop(p))) {
if (p->col + sz >= p->maxcols)
adjbuf(p, p->col + sz);
- memcpy(&p->buf[(int)p->col], word, sz);
- p->col += sz;
+ for (i = 0; i < (int)sz; i++)
+ p->buf[(int)p->col++] = word[i];
return;
}