Fix uip/whom.c for C89 compatibility
[mmh] / uip / mhoutsbr.c
index 4d04b65..87e7943 100644 (file)
@@ -9,9 +9,7 @@
 
 #include <h/mh.h>
 #include <fcntl.h>
-#include <h/signals.h>
 #include <errno.h>
-#include <signal.h>
 #include <h/tws.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
@@ -230,7 +228,7 @@ writeQuoted(CT ct, FILE *out)
                        n = 0;
                }
                for (; *cp; cp++) {
-                       if (n > CPERLIN - 3) {
+                       if (n + 1 >= CPERLIN) {
                                fputs("=\n", out);
                                n = 0;
                        }
@@ -243,8 +241,16 @@ writeQuoted(CT ct, FILE *out)
                                break;
 
                        default:
-                               if (*cp < '!' || *cp > '~')
+                               if (*cp < '!' || *cp > '~') {
                                        goto three_print;
+                               }
+                               if (n == 0 && *cp == '.') {
+                                       /*
+                                       ** encode dot at start of line,
+                                       ** because it could be alone ...
+                                       */
+                                       goto three_print;
+                               }
                                putc(*cp, out);
                                n++;
                                break;