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:
6
figlet.c
6
figlet.c
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user