Sfoglia il codice sorgente

Fix commands not working in telnet #43 - release

Sebastien 4 anni fa
parent
commit
a90c9802ab
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      components/telnet/telnet.c

+ 4 - 0
components/telnet/telnet.c

@@ -253,6 +253,10 @@ void process_received_data(const char * buffer, size_t size){
 		if(bMirrorToUART){
 			write(uart_fd, command, size);
 		}
+		for(int i=strlen(command);i>=0;i--){
+			// strip any cr/lf
+			if(command[i]== '\n' || command[i]== '\r') command[i]= '\0';
+		}
 		run_command((char *)command);
 	}
 	free(command);