check return value of m_getfld2 befor using the field
[mmh] / uip / distsbr.c
index 9c20fda..058875c 100644 (file)
@@ -182,10 +182,10 @@ ready_msg(char *msgnam)
                                return NOTOK;
                        }
                        unlink(tmpfil);
-                       fprintf(ofp, "\n%s", f.value);
+                       fputs("\n", ofp);
                        while (state == BODY2) {
-                               state = m_getfld2(state, &f, ifp);
                                fputs(f.value, ofp);
+                               state = m_getfld2(state, &f, ifp);
                        }
                        /* FALL */