@@ -422,7 +422,7 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) {
422
422
mp_uint_t port = netutils_parse_inet_addr (addr_in , ip , NETUTILS_LITTLE );
423
423
424
424
// call the NIC to bind the socket
425
- int _errno ;
425
+ int _errno = 0 ;
426
426
if (wlan_socket_bind (self , ip , port , & _errno ) != 0 ) {
427
427
mp_raise_OSError (- _errno );
428
428
}
@@ -459,8 +459,8 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) {
459
459
460
460
// accept the incoming connection
461
461
uint8_t ip [MOD_NETWORK_IPV4ADDR_BUF_SIZE ];
462
- mp_uint_t port ;
463
- int _errno ;
462
+ mp_uint_t port = 0 ;
463
+ int _errno = 0 ;
464
464
if (wlan_socket_accept (self , socket2 , ip , & port , & _errno ) != 0 ) {
465
465
mp_raise_OSError (- _errno );
466
466
}
@@ -546,7 +546,7 @@ STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_
546
546
mp_uint_t port = netutils_parse_inet_addr (addr_in , ip , NETUTILS_LITTLE );
547
547
548
548
// call the nic to sendto
549
- int _errno ;
549
+ int _errno = 0 ;
550
550
mp_int_t ret = wlan_socket_sendto (self , bufinfo .buf , bufinfo .len , ip , port , & _errno );
551
551
if (ret < 0 ) {
552
552
mp_raise_OSError (- _errno );
@@ -561,8 +561,8 @@ STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) {
561
561
vstr_t vstr ;
562
562
vstr_init_len (& vstr , mp_obj_get_int (len_in ));
563
563
byte ip [4 ];
564
- mp_uint_t port ;
565
- int _errno ;
564
+ mp_uint_t port = 0 ;
565
+ int _errno = 0 ;
566
566
mp_int_t ret = wlan_socket_recvfrom (self , (byte * )vstr .buf , vstr .len , ip , & port , & _errno );
567
567
if (ret < 0 ) {
568
568
if (_errno == MP_EAGAIN && self -> sock_base .has_timeout ) {
0 commit comments