Forráskód Böngészése

telnet / escape - release

Philippe G 3 éve
szülő
commit
21f3768ada
1 módosított fájl, 1 hozzáadás és 6 törlés
  1. 1 6
      components/telnet/telnet.c

+ 1 - 6
components/telnet/telnet.c

@@ -240,12 +240,7 @@ void process_received_data(const char * buffer, size_t size){
 	const char * c=buffer;
 	const char * c=buffer;
 
 
 	// scrub from any escape command
 	// scrub from any escape command
-	if(*c == '\e'){
-		while(*(c++) != '\n'){
-			--size;
-		};
-		--size;
-	}
+	if(*c == '\e') while (size && size-- && *c++ != '\n');
 	memcpy(command,c,size);
 	memcpy(command,c,size);
 	command[size]='\0';
 	command[size]='\0';
 	if(command[0]!='\r' && command[0]!='\n'){
 	if(command[0]!='\r' && command[0]!='\n'){