@@ -120,7 +120,7 @@ int usb_rebind_kernel_driver_np()
120
120
}
121
121
122
122
123
- int G25send_command (char command [ 7 ] ) {
123
+ int G25send_command (const char * command , unsigned int command_size ) {
124
124
125
125
int stat ;
126
126
@@ -143,7 +143,7 @@ int G25send_command(char command[7]) {
143
143
}
144
144
if (verbose_flag ) printf ("USB interface claimed\n" );
145
145
146
- stat = usb_interrupt_write (usb_handle , 1 , command , sizeof ( command ) , 100 );
146
+ stat = usb_interrupt_write (usb_handle , 1 , command , command_size , 100 );
147
147
if ( (stat < 0 ) ) {
148
148
if ( (stat == - ENODEV ) && verbose_flag ) fprintf (stderr , "usb_interrupt_write: No such device, changed identity ?\n" );
149
149
}
@@ -174,7 +174,7 @@ int G25native() {
174
174
dev = usb_find_device (VENDOR ,G25NORMAL );
175
175
if ( dev != NULL ) {
176
176
char setextended [] = { 0xf8 , 0x10 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };
177
- G25send_command (setextended );
177
+ G25send_command (setextended , sizeof ( setextended ) );
178
178
}
179
179
else {
180
180
printf ("Unable to find G25 device.\n" );
@@ -186,7 +186,7 @@ int G25range(unsigned short int range) {
186
186
dev = usb_find_device (VENDOR ,G25EXTENDED );
187
187
if ( dev != NULL ) {
188
188
char setrange [] = { 0xf8 , 0x81 , range & 0x00ff , (range & 0xff00 )>>8 , 0x00 , 0x00 , 0x00 };
189
- G25send_command (setrange );
189
+ G25send_command (setrange , sizeof ( setrange ) );
190
190
}
191
191
return 0 ;
192
192
}
0 commit comments