diff options
author | David Malone <dwmalone@FreeBSD.org> | 2004-05-19 21:34:52 +0000 |
---|---|---|
committer | David Malone <dwmalone@FreeBSD.org> | 2004-05-19 21:34:52 +0000 |
commit | 838c00236b8cd91879cd7a43b23fd66a0b957aa6 (patch) | |
tree | da010377cf1cbdea2ed4a981694c5370d693b97b /usr.bin/rusers/rusers.c | |
parent | f2ab33b6eb2dcc33305acd16de73f695a134b556 (diff) | |
download | src-838c00236b8cd91879cd7a43b23fd66a0b957aa6.tar.gz src-838c00236b8cd91879cd7a43b23fd66a0b957aa6.zip |
Fix a couple of warnings:
1) Missing include for declaration of time conversion functions.
2) Avoid a couple of alignment warnings on 64 bit arches by memcpying the
things pointed to by caddrs into variables of the right type.
Bump WARNS to 6 while I'm here.
Notes
Notes:
svn path=/head/; revision=129459
Diffstat (limited to 'usr.bin/rusers/rusers.c')
-rw-r--r-- | usr.bin/rusers/rusers.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c index 7d2fc0acd9d3..87f46608870b 100644 --- a/usr.bin/rusers/rusers.c +++ b/usr.bin/rusers/rusers.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <timeconv.h> #include <unistd.h> #define MAX_INT 0x7fffffff @@ -97,10 +98,12 @@ rusers_reply(caddr_t replyp, struct sockaddr_in *raddrp) int idle; char date[32], idle_time[64], remote[64]; struct hostent *hp; - utmpidlearr *up = (utmpidlearr *)replyp; + utmpidlearr *up, u; char *host; int days, hours, minutes, seconds; + up = &u; + memcpy(up, replyp, sizeof(*up)); if (search_host(raddrp->sin_addr)) return (0); @@ -191,7 +194,7 @@ onehost(char *host) if (clnt_call(rusers_clnt, RUSERSPROC_NAMES, (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_utmpidlearr, &up, tv) != RPC_SUCCESS) errx(1, "%s", clnt_sperror(rusers_clnt, "")); - addr.sin_addr.s_addr = *(int *)hp->h_addr; + memcpy(&addr.sin_addr.s_addr, hp->h_addr, sizeof(addr.sin_addr.s_addr)); rusers_reply((caddr_t)&up, &addr); clnt_destroy(rusers_clnt); } |