ctb server bug fix: udp ip not reset before overwriting (smaller size creates problems)

This commit is contained in:
maliakal_d 2019-05-14 17:08:07 +02:00
parent 3f6736ad23
commit 741ee3b44c
3 changed files with 2 additions and 1 deletions

View File

@ -28,6 +28,7 @@ int getUdPSocketDescriptor() {
int setUDPDestinationDetails(const char* ip, unsigned short int port) {
udpDestinationPort = port;
size_t len = strlen(ip);
memset(udpDestinationIp, 0, MAX_STR_LENGTH);
strncpy(udpDestinationIp, ip, len > MAX_STR_LENGTH ? MAX_STR_LENGTH : len );
if (udpServerAddrInfo) {

View File

@ -7,4 +7,4 @@
#define APIRECEIVER 0x190405
#define APIGUI 0x190405
#define APIEIGER 0x190418
#define APICTB 0x190503
#define APICTB 0x190514