From 46b6fb73529e79de5452e9d25e26a7c8b83bd79f Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 14 May 2011 17:54:42 +0000 Subject: 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. --- term.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'term.c') diff --git a/term.c b/term.c index 9b158e54..2810d620 100644 --- a/term.c +++ b/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.186 2011/04/30 22:24:31 kristaps Exp $ */ +/* $Id: term.c,v 1.187 2011/05/14 17:54:42 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -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; } -- cgit v1.2.3-56-ge451