Skip to content
Snippets Groups Projects
Commit da96dddb authored by deuce's avatar deuce
Browse files

getfont() can return -1.

Deal with that fact.
parent ea8e3530
Branches
Tags
No related merge requests found
......@@ -1032,6 +1032,7 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_puttext(int a,int b,int c,int d,void *e)
if(ciolib_xlat) {
font = ciolib_getfont();
if (font >= 0) {
buf=malloc((c-a+1)*(d-b+1)*2);
if (conio_fontdata[font].put_xlat == NULL) {
memcpy(buf, e, (c-a+1)*(d-b+1)*2);
......@@ -1046,8 +1047,9 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_puttext(int a,int b,int c,int d,void *e)
}
}
}
}
ret = cio_api.puttext(a,b,c,d,(void *)buf);
if (ciolib_xlat)
if (buf != e)
free(buf);
return ret;
}
......@@ -1065,6 +1067,7 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_gettext(int a,int b,int c,int d,void *e)
ret = cio_api.gettext(a,b,c,d,e);
if(ciolib_xlat) {
font = ciolib_getfont();
if (font >= 0) {
if (conio_fontdata[font].put_xlat) {
for (i=0; i<(c-a+1)*(d-b+1)*2; i+=2) {
xlat = ((char *)e)[i];
......@@ -1076,6 +1079,7 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_gettext(int a,int b,int c,int d,void *e)
}
}
}
}
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment