Skip to content

Commit c725783

Browse files
committed
Add check in vql_attributes for number of intout parameters
Not all VDI implementations return the line end styles in intout[3/4] (eg. original TOS does not)
1 parent 83d4f04 commit c725783

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

vql_attributes.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ vql_attributes (short handle, short attrib[])
2020
{
2121
short *ptr;
2222
short vdi_control[VDI_CNTRLMAX];
23-
short vdi_intout[5];
23+
short vdi_intout[5];
2424
short vdi_ptsout[2];
2525

2626
VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_ptsout );
@@ -32,6 +32,14 @@ vql_attributes (short handle, short attrib[])
3232
*(attrib ++) = *(ptr ++); /* attrib[1] = vdi_intout[1]; */
3333
*(attrib ++) = *(ptr ++); /* attrib[2] = vdi_intout[2]; */
3434
*(attrib ++) = vdi_ptsout[0]; /* attrib[3] = vdi_ptsout[0]; */
35-
*(attrib ++) = *(ptr ++); /* attrib[4] = vdi_intout[3]; */
36-
*(attrib ) = *(ptr ); /* attrib[5] = vdi_intout[4]; */
35+
/* TOS/EmuTOS do not return the line end styles in intout[3/4] */
36+
if (vdi_control[4] >= 5)
37+
{
38+
*(attrib ++) = *(ptr ++); /* attrib[4] = vdi_intout[3]; */
39+
*(attrib ) = *(ptr ); /* attrib[5] = vdi_intout[4]; */
40+
} else
41+
{
42+
*(attrib ++) = 0;
43+
*(attrib ) = 0;
44+
}
3745
}

0 commit comments

Comments
 (0)