@@ -405,7 +405,7 @@ static int get_computer_model(char *model, int len)
405
405
* Returns 1 if yes and 0 otherwise.
406
406
*/
407
407
408
- static int check_computer_model (char * target )
408
+ static int check_computer_model (const char * target )
409
409
{
410
410
char model [256 ] = "" ;
411
411
if (get_computer_model (model , sizeof (model )) == 0 ) {
@@ -495,7 +495,7 @@ static int get_hub_info(struct libusb_device *dev, struct hub_info *info)
495
495
}
496
496
497
497
/* Get container_id: */
498
- bzero (info -> container_id , sizeof (info -> container_id ));
498
+ memset (info -> container_id , 0 , sizeof (info -> container_id ));
499
499
struct libusb_bos_descriptor * bos ;
500
500
rc = libusb_get_bos_descriptor (devh , & bos );
501
501
if (rc == 0 ) {
@@ -743,7 +743,7 @@ static int get_device_description(struct libusb_device * dev, struct descriptor_
743
743
rc = libusb_get_device_descriptor (dev , & desc );
744
744
if (rc )
745
745
return rc ;
746
- bzero (ds , sizeof (* ds ));
746
+ memset (ds , 0 , sizeof (* ds ));
747
747
id_vendor = desc .idVendor ;
748
748
id_product = desc .idProduct ;
749
749
rc = libusb_open (dev , & devh );
@@ -767,7 +767,7 @@ static int get_device_description(struct libusb_device * dev, struct descriptor_
767
767
}
768
768
if (desc .bDeviceClass == LIBUSB_CLASS_HUB ) {
769
769
struct hub_info info ;
770
- bzero (& info , sizeof (info ));
770
+ memset (& info , 0 , sizeof (info ));
771
771
rc = get_hub_info (dev , & info );
772
772
if (rc == 0 ) {
773
773
const char * lpsm_type ;
@@ -825,7 +825,7 @@ static int print_port_status(struct hub_info * hub, int portmask)
825
825
printf (" Port %d: %04x" , port , port_status );
826
826
827
827
struct descriptor_strings ds ;
828
- bzero (& ds , sizeof (ds ));
828
+ memset (& ds , 0 , sizeof (ds ));
829
829
struct libusb_device * udev ;
830
830
int i = 0 ;
831
831
while ((udev = usb_devs [i ++ ]) != NULL ) {
@@ -920,7 +920,7 @@ static int usb_find_hubs(void)
920
920
if (rc == 0 && desc .bDeviceClass != LIBUSB_CLASS_HUB )
921
921
continue ;
922
922
struct hub_info info ;
923
- bzero (& info , sizeof (info ));
923
+ memset (& info , 0 , sizeof (info ));
924
924
rc = get_hub_info (dev , & info );
925
925
if (rc ) {
926
926
perm_ok = 0 ; /* USB permission issue? */
@@ -946,7 +946,7 @@ static int usb_find_hubs(void)
946
946
(memcmp (info .port_numbers , dev_pn , info .pn_len ) == 0 ))
947
947
{
948
948
struct descriptor_strings ds ;
949
- bzero (& ds , sizeof (ds ));
949
+ memset (& ds , 0 , sizeof (ds ));
950
950
rc = get_device_description (udev , & ds );
951
951
if (rc != 0 )
952
952
break ;
0 commit comments