Fix rendering corruption on multiline smushing

Fix output corruption on line breaks caused by a previous attempt to
fix invalid memory accesses when smushing at the start of the line.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Claudio Matsuoka
2011-01-23 12:13:46 -02:00
parent 8414100581
commit bcc3cecb4f

View File

@ -1483,7 +1483,7 @@ int smushamt()
int addchar(c)
inchr c;
{
int smushamount,row,k,column,offset;
int smushamount,row,k,column;
outchr *templine;
getletter(c);
@ -1493,7 +1493,6 @@ inchr c;
return 0;
}
offset = 0;
templine = (outchr*)myalloc(sizeof(outchr)*(outlinelenlimit+1));
for (row=0;row<charheight;row++) {
if (right2left) {
@ -1509,11 +1508,10 @@ inchr c;
for (k=0;k<smushamount;k++) {
column = outlinelen-smushamount+k;
if (column < 0) {
offset = -column;
column = 0;
}
outputline[row][column] =
smushem(outputline[row][column],currchar[row][k + offset]);
smushem(outputline[row][column],currchar[row][k]);
}
STRCAT(outputline[row],currchar[row]+smushamount);
}