Prechádzať zdrojové kódy

fix set relay (snmp)

balbekova 7 rokov pred
rodič
commit
a1c5c2d419
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 3 0
      modules/Ethernet/private_mib.c

+ 3 - 0
modules/Ethernet/private_mib.c

@@ -624,6 +624,7 @@ static u8_t signals_set_test (struct obj_def *od, u16_t len, void *value)
 		if ( len <= 1 )
 	    {
 		   val_string = (char*)value;
+		   val_string[len] = 0;
 		   if(atoi(val_string) <= 1){
 			   if(sSettings.sInOuts.ro_type_source[0] == SNMP_SET)
 				   set_ok = 1;
@@ -634,6 +635,7 @@ static u8_t signals_set_test (struct obj_def *od, u16_t len, void *value)
 		if ( len <= 1 )
 		{
 		   val_string = (char*)value;
+		   val_string[len] = 0;
 		   if(atoi(val_string) <= 1){
 			   if(sSettings.sInOuts.ro_type_source[1] == SNMP_SET)
 				   set_ok = 1;
@@ -650,6 +652,7 @@ static u8_t signals_set_test (struct obj_def *od, u16_t len, void *value)
 		if ( len <= 3 )
 		{
 		   val_string = (char*)value;
+		   val_string[len] = 0;
 		   if(atof(val_string) <= 10){
 			set_ok = 1;
 		   }