Enhance wasm loader and interpreter, enhance code security and update document (#149)

This commit is contained in:
wenyongh
2019-12-13 15:30:30 +08:00
committed by GitHub
parent 1c81ad6da5
commit 631b7a2403
45 changed files with 678 additions and 646 deletions

View File

@ -35,8 +35,10 @@ bool tcp_init(const char *address, uint16_t port, int *fd)
servaddr.sin_addr.s_addr = inet_addr(address);
servaddr.sin_port = htons(port);
if (connect(sock, (SA*) &servaddr, sizeof(servaddr)) != 0)
if (connect(sock, (SA*) &servaddr, sizeof(servaddr)) != 0) {
close(sock);
return false;
}
*fd = sock;
return true;
@ -93,7 +95,7 @@ bool uart_init(const char *device, int baudrate, int *fd)
uart_fd = open(device, O_RDWR | O_NOCTTY);
if (uart_fd <= 0)
if (uart_fd < 0)
return false;
memset(&uart_term, 0, sizeof(uart_term));