]> diplodocus.org Git - nmh/blobdiff - uip/msh.c
Added check of a header with name that's 998 bytes long to
[nmh] / uip / msh.c
index 7b5575eded2730f730ddd0fbf184e6a0a4de2ab3..36286e0b1d2478aad8832dd29b3b017be741b8a2 100644 (file)
--- a/uip/msh.c
+++ b/uip/msh.c
@@ -25,7 +25,7 @@
 #include <termios.h>
 
 #include <pwd.h>
-#include <h/m_setjmp.h>
+#include <setjmp.h>
 #include <signal.h>
 #include <h/msh.h>
 #include <h/vmhsbr.h>
@@ -235,10 +235,10 @@ main (int argc, char **argv)
                case HELPSW: 
                    snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
                    print_help (buf, switches, 1);
-                   done (1);
+                   done (0);
                case VERSIONSW:
                    print_version(invo_name);
-                   done (1);
+                   done (0);
 
                case IDSW: 
                    if (!(cp = *argp++) || *cp == '-')
@@ -801,10 +801,10 @@ m_gMsgs (int n)
 FILE *
 msh_ready (int msgnum, int full)
 {
-    NMH_UNUSED (full);
     register int msgp;
     int fd;
     char *cp;
+    NMH_UNUSED (full);
 
     if (yp) {
        fclose (yp);
@@ -1005,15 +1005,17 @@ readid (int msgnum)
        return Msgs[msgnum].m_bboard_id;
 
     zp = msh_ready (msgnum, 0);
-    for (state = FLD;;)
-       switch (state = m_getfld (state, name, buf, sizeof(buf), zp)) {
+    for (state = FLD;;) {
+       int bufsz = sizeof buf;
+       switch (state = m_getfld (state, name, buf, &bufsz, zp)) {
            case FLD: 
            case FLDEOF: 
            case FLDPLUS: 
                if (!mh_strcasecmp (name, BBoard_ID)) {
                    bp = getcpy (buf);
                    while (state == FLDPLUS) {
-                       state = m_getfld (state, name, buf, sizeof(buf), zp);
+                       bufsz = sizeof buf;
+                       state = m_getfld (state, name, buf, &bufsz, zp);
                        bp = add (buf, bp);
                    }
                    i = atoi (bp);
@@ -1024,13 +1026,15 @@ readid (int msgnum)
                        continue;
                }
                while (state == FLDPLUS)
-                   state = m_getfld (state, name, buf, sizeof(buf), zp);
+                   bufsz = sizeof buf;
+                   state = m_getfld (state, name, buf, &bufsz, zp);
                if (state != FLDEOF)
                    continue;
 
            default: 
                return 0;
        }
+    }
 }
 
 
@@ -1915,7 +1919,7 @@ pFIN (void)
 {
     int status;
 
-    switch (m_setjmp (peerenv)) {
+    switch (setjmp (peerenv)) {
        case OK: 
            SIGNAL (SIGALRM, alrmser);
            alarm (ALARM);