Path: blob/main/comms/aprsd/files/patch-src_queryResp.cpp
16461 views
--- src/queryResp.cpp.orig 2003-03-31 04:49:40 UTC1+++ src/queryResp.cpp2@@ -40,6 +40,9 @@34#include <netinet/in.h>5#include <arpa/inet.h>6+#if (defined(__unix__) || defined(unix)) && !defined(USG)7+#include <sys/param.h>8+#endif910#include "constant.h"11#include "utils.h"12@@ -84,7 +87,6 @@ void queryResp(int source, const aprsString* pkt)13if ((rc = gethostname(hostname,80)) != 0)14strcpy(hostname, "Host_Unknown");15else {16-17//Thread-Safe verison of gethostbyname()18h = NULL;19rc = gethostbyname_r(hostname,20@@ -94,12 +96,10 @@ void queryResp(int source, const aprsString* pkt)21&h,22&h_err);2324-25-26if ((rc == 0) && (h!= NULL)) {27strncpy(hostname,h->h_name,80); //Copy Full host name28hostname[79] = '\0'; //Be sure it's terminated29- strncpy((char*)hip,h->h_addr_list[0],4); //Copy Host IP30+ memcpy((void*)hip,(void*)h->h_addr_list[0],4); //Copy Host IP31}32}33343536