| Server IP : 82.208.35.60 / Your IP : 216.73.216.168 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/comms/aprsd/files/ |
Upload File : |
--- src/queryResp.cpp.orig 2003-03-31 04:49:40 UTC
+++ src/queryResp.cpp
@@ -40,6 +40,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
#include "constant.h"
#include "utils.h"
@@ -84,7 +87,6 @@ void queryResp(int source, const aprsString* pkt)
if ((rc = gethostname(hostname,80)) != 0)
strcpy(hostname, "Host_Unknown");
else {
-
//Thread-Safe verison of gethostbyname()
h = NULL;
rc = gethostbyname_r(hostname,
@@ -94,12 +96,10 @@ void queryResp(int source, const aprsString* pkt)
&h,
&h_err);
-
-
if ((rc == 0) && (h!= NULL)) {
strncpy(hostname,h->h_name,80); //Copy Full host name
hostname[79] = '\0'; //Be sure it's terminated
- strncpy((char*)hip,h->h_addr_list[0],4); //Copy Host IP
+ memcpy((void*)hip,(void*)h->h_addr_list[0],4); //Copy Host IP
}
}