Skip to content

Commit 398838c

Browse files
committed
Initialize output vectors in vex_* functions to 0
Some calls (especially vex_wheelv) may not be supported
1 parent aedb724 commit 398838c

File tree

6 files changed

+10
-1
lines changed

6 files changed

+10
-1
lines changed

n_vq_margins.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ vq_margins (short handle, short *top_margin, short *bottom_margin,
5050
* NVDI 5.x printer drivers have a bug, and write some output parameters
5151
* directly to the VDIPB instead of the intout array.
5252
* Because of another bug in the same routine,
53-
* it also does not return the value of vdpi
53+
* it also does not return the value of vdpi.
54+
* Because of another bug in the same routine,
55+
* top and bottom margins are swapped
5456
*/
5557
if (vdi_params.control != vdi_control)
5658
{
@@ -68,6 +70,8 @@ vq_margins (short handle, short *top_margin, short *bottom_margin,
6870
/* vdpi is not accessible; pb[3] will contain the y-resolution */
6971
/* assume vdpi == hdpi */
7072
*vdpi = pb[2];
73+
*bottom_margin = vdi_intout[1];
74+
*top_margin = vdi_intout[2];
7175
}
7276

7377
return vdi_intout[0];

vex_butv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ vex_butv (short handle, void *newhdlr, void **old)
2222
VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy );
2323

2424
vdi_control_ptr(0, void *) = newhdlr;
25+
vdi_control_ptr(1, void *) = 0;
2526

2627
VDI_TRAP_00 (vdi_params, handle, 125);
2728

vex_curv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ vex_curv (short handle, void *new, void **old)
2828
VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy);
2929

3030
vdi_control_ptr(0, void *) = new;
31+
vdi_control_ptr(1, void *) = 0;
3132

3233
VDI_TRAP_00 (vdi_params, handle, 127);
3334

vex_motv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ vex_motv (short handle, void *new, void **old)
2424
VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy );
2525

2626
vdi_control_ptr(0, void *) = new;
27+
vdi_control_ptr(1, void *) = 0;
2728

2829
VDI_TRAP_00 (vdi_params, handle, 126);
2930

vex_timv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ vex_timv (short handle, void *time_addr, void **otime_addr, short *time_conv)
2525
VDI_PARAMS(vdi_control, 0L, 0L, vdi_intout, vdi_dummy );
2626

2727
vdi_control_ptr(0, void *) = time_addr;
28+
vdi_control_ptr(1, void *) = 0;
2829

2930
VDI_TRAP_00 (vdi_params, handle, 118);
3031

vex_wheelv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ vex_wheelv (short handle, void *new, void **old)
2525
VDI_PARAMS(vdi_control, 0L, 0L, vdi_dummy, vdi_dummy );
2626

2727
vdi_control_ptr(0, void *) = new;
28+
vdi_control_ptr(1, void *) = 0;
2829

2930
VDI_TRAP_00 (vdi_params, handle, 134);
3031

0 commit comments

Comments
 (0)