Browse Source

compile fixes (#1022)

pull/1024/head
Logan oos Even 2 years ago
committed by GitHub
parent
commit
c0259ae967
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      tools/n2n-portfwd.c
  2. 3
      tools/n2n-route.c

3
tools/n2n-portfwd.c

@ -218,6 +218,7 @@ int main (int argc, char* argv[]) {
n2n_portfwd_conf_t ppp; n2n_portfwd_conf_t ppp;
uint8_t c; uint8_t c;
char *p;
SOCKET sock; SOCKET sock;
size_t msg_len; size_t msg_len;
char udp_buf[N2N_PKT_BUF_SIZE]; char udp_buf[N2N_PKT_BUF_SIZE];
@ -321,7 +322,7 @@ reset_main_loop:
if((msg_len > 0) && (msg_len < sizeof(udp_buf))) { if((msg_len > 0) && (msg_len < sizeof(udp_buf))) {
// make sure it is a string and replace all newlines with spaces // make sure it is a string and replace all newlines with spaces
udp_buf[msg_len] = '\0'; udp_buf[msg_len] = '\0';
for (char *p = udp_buf; (p = strchr(p, '\n')) != NULL; p++) *p = ' '; for (p = udp_buf; (p = strchr(p, '\n')) != NULL; p++) *p = ' ';
traceEvent(TRACE_DEBUG, "received '%s' from management port", udp_buf); traceEvent(TRACE_DEBUG, "received '%s' from management port", udp_buf);
// handle the answer, json needs to be freed later // handle the answer, json needs to be freed later

3
tools/n2n-route.c

@ -551,6 +551,7 @@ int main (int argc, char* argv[]) {
n2n_route_conf_t rrr; n2n_route_conf_t rrr;
uint8_t c; uint8_t c;
char *p;
SOCKET sock; SOCKET sock;
size_t msg_len; size_t msg_len;
char udp_buf[N2N_PKT_BUF_SIZE]; char udp_buf[N2N_PKT_BUF_SIZE];
@ -756,7 +757,7 @@ reset_main_loop:
if((msg_len > 0) && (msg_len < sizeof(udp_buf))) { if((msg_len > 0) && (msg_len < sizeof(udp_buf))) {
// make sure it is a string and replace all newlines with spaces // make sure it is a string and replace all newlines with spaces
udp_buf[msg_len] = '\0'; udp_buf[msg_len] = '\0';
for (char *p = udp_buf; (p = strchr(p, '\n')) != NULL; p++) *p = ' '; for (p = udp_buf; (p = strchr(p, '\n')) != NULL; p++) *p = ' ';
traceEvent(TRACE_DEBUG, "received '%s' from management port", udp_buf); traceEvent(TRACE_DEBUG, "received '%s' from management port", udp_buf);
// handle the answer, json needs to be freed later // handle the answer, json needs to be freed later

Loading…
Cancel
Save