--- netkit-rwho-0.17-org/rwhod/rwhod.c Sat Jul 22 21:19:48 2000 +++ netkit-rwho-0.17/rwhod/rwhod.c Sat Jul 6 11:53:50 2002 @@ -69,6 +69,7 @@ #include #include #include +#include #include "daemon.h" @@ -95,7 +96,7 @@ static void broadcaster(void); static int configure(int s); static int verify(const char *name); -static int getloadavg(double ptr[3], int n); +int getloadavg(double ptr[3], int n); /* * We communicate with each neighbor in @@ -273,7 +274,7 @@ wd.wd_hostname[sizeof(wd.wd_hostname)-1] = 0; if (!verify(wd.wd_hostname)) { syslog(LOG_WARNING, "malformed host name from %x", - from.sin_addr); + from.sin_addr.s_addr); continue; } snprintf(path, sizeof(path), "whod.%s", wd.wd_hostname); @@ -359,9 +360,9 @@ *cp = '\0'; mynamelen = strlen(myname); if (mynamelen > sizeof(mywd.wd_hostname)) - mynamelen = sizeof(mywd.wd_hostname); + mynamelen = sizeof(mywd.wd_hostname) - 1; strncpy(mywd.wd_hostname, myname, mynamelen); - mywd.wd_hostname[sizeof(mywd.wd_hostname)-1] = 0; + mywd.wd_hostname[mynamelen] = 0; getboottime(&mywd);