]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/wu.c
Update copyright notice
[empserver] / src / lib / subs / wu.c
index ee7b7407b9ca8ae376e86562d8bb8adacb239fbd..2b7b7eec3b5344d8c7ad5cabcdcad1b41e0f0548 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -115,7 +115,7 @@ wu(natid from, natid to, char *format, ...)
 int
 typed_wu(natid from, natid to, char *message, int type)
 {
-    int len;
+    size_t len;
     struct telstr tel;
     struct natstr *np;
     struct iovec iov[2];
@@ -131,7 +131,7 @@ typed_wu(natid from, natid to, char *message, int type)
        mailbox(box, to);
 
     if (type != TEL_ANNOUNCE)
-       if ((np = getnatp(to)) == 0 || np->nat_stat < STAT_SANCT)
+       if (!(np = getnatp(to)) || np->nat_stat < STAT_SANCT)
            return -1;
 #if !defined(_WIN32)
     if ((fd = open(box, O_WRONLY | O_APPEND, 0)) < 0) {
@@ -145,10 +145,6 @@ typed_wu(natid from, natid to, char *message, int type)
     tel.tel_from = from;
     (void)time(&tel.tel_date);
     len = strlen(message);
-    if (CANT_HAPPEN(len > MAXTELSIZE)) {
-       len = MAXTELSIZE;
-       message[len] = 0;
-    }
     tel.tel_length = len;
     tel.tel_type = type;
     iov[0].iov_base = &tel;