diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-05-14 17:54:42 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-05-14 17:54:42 +0000 |
commit | c6f3075846c286cebabf731303d52660dd30afe8 (patch) | |
tree | 7fc3844d639c5d82fd378b30e3461c0fc7f04174 /term.c | |
parent | 121fc3d4eff42f9400d7e165b83c068757148a7b (diff) | |
download | mandoc-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |