- *cp = '\0';
-
- if (strncmp (cp = buffer, "From ", sizeof("From ") - 1) == 0) {
- fprintf (out, "=%02X", *cp++ & 0xff);
- n = 3;
- } else {
- n = 0;
+ gotlen--;
+
+ /*
+ * if the line starts with "From ", encode the 'F' so it
+ * doesn't falsely match an mbox delimiter.
+ */
+ cp = bufp;
+ if (gotlen >= 5 && strncmp (cp, "From ", 5) == 0) {
+ fprintf (out, "=%02X", 'F');
+ cp++;
+ n += 3;