]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/wu.c
subs: Oops when a telegram doesn't end with a newline
[empserver] / src / lib / subs / wu.c
index cf3c175af9f3cd1c18ce75502f162d30a9ee2351..cbcf979e2ded1d94382f6e0248aad71771109a5a 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 2000
- *     Markus Armbruster, 2005-2011
+ *     Markus Armbruster, 2005-2015
  */
 
 #include <config.h>
@@ -138,6 +138,7 @@ typed_wu(natid from, natid to, char *message, int type)
     tel.tel_from = from;
     (void)time(&tel.tel_date);
     len = strlen(message);
+    CANT_HAPPEN(len && message[len - 1] != '\n');
     tel.tel_length = len;
     tel.tel_type = type;
     tel.tel_cont = !telegram_is_new(to, &tel);