]> mj.ucw.cz Git - nwho.git/blobdiff - nwhod.c
Moved calculation of packet size to an extra function
[nwho.git] / nwhod.c
diff --git a/nwhod.c b/nwhod.c
index b5fc22d288df218a6a023ffbfef165e28da99506..caa9f8f04fc2fda271a8e0426fbf73b05b852119 100644 (file)
--- a/nwhod.c
+++ b/nwhod.c
@@ -359,7 +359,7 @@ client(char *serv)
     {
       now = time(NULL);
       make_pkt(&pkt);
-      if (send(sock, &pkt, sizeof(pkt) - (MAX_USERS - ntohl(pkt.num_users))*sizeof(struct userinfo), 0) < 0)
+      if (send(sock, &pkt, nwho_pkt_size(&pkt), 0) < 0)
        syslog(LOG_ERR, "sendmsg: %m");
       sleep(DEFAULT_SEND_TIME);
     }