]> mj.ucw.cz Git - nwho.git/commitdiff
Use socklen_t properly
authorMartin Mares <mj@ucw.cz>
Fri, 31 Dec 2010 15:05:04 +0000 (16:05 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 31 Dec 2010 15:05:04 +0000 (16:05 +0100)
Squashes a compiler warning about different signedness.

nwhod.c

diff --git a/nwhod.c b/nwhod.c
index f432d00d67f418f21ee83a0d0d88285fe4e1a33c..c6ebade19f03c52ce9646716c6b8d9e090e3a01c 100644 (file)
--- a/nwhod.c
+++ b/nwhod.c
@@ -199,16 +199,16 @@ is_valid(u32 ipa)
 static void
 receive(void)
 {
-  int r, al;
+  int r;
   struct nwho_pkt pkt;
   struct sockaddr_in sa;
+  socklen_t al = sizeof(sa);
   int n = sizeof(struct nwho_pkt) - MAX_USERS * sizeof(struct userinfo);
   struct hostrec *e;
   struct hostent *h;
   char *c;
 
   alarm(DEFAULT_PRUNE_TIME);
-  al = sizeof(sa);
   r = recvfrom(sock, &pkt, sizeof(pkt), 0, (struct sockaddr *) &sa, &al);
   alarm(0);
   now = time(NULL);