summaryrefslogtreecommitdiff
path: root/mail/nmh-devel/files/patch-test_fakesmtp.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2023-12-08 15:39:12 -0800
committerCy Schubert <cy@FreeBSD.org>2023-12-08 15:42:08 -0800
commit7767c9dff70c419bf936b26e8ada6a545dab5817 (patch)
treea6aef688ca2357c6d25dafacd07535c4d9928e5b /mail/nmh-devel/files/patch-test_fakesmtp.c
parentmail/nmh-devel: update to latest git commit on savannah (diff)
mail/nmh-devel: Fix message corruption
Upstream 8f897f65 (2023-03-12) has resulted in data corruption with sent emails. This commit removes this upstream commmit and all that subsequently "fix" it.
Diffstat (limited to 'mail/nmh-devel/files/patch-test_fakesmtp.c')
-rw-r--r--mail/nmh-devel/files/patch-test_fakesmtp.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/mail/nmh-devel/files/patch-test_fakesmtp.c b/mail/nmh-devel/files/patch-test_fakesmtp.c
new file mode 100644
index 000000000000..65fa3c744d58
--- /dev/null
+++ b/mail/nmh-devel/files/patch-test_fakesmtp.c
@@ -0,0 +1,29 @@
+--- test/fakesmtp.c.orig 2023-12-04 03:00:44 UTC
++++ test/fakesmtp.c
+@@ -35,13 +35,12 @@ enum {
+ SMTP_XOAUTH_ERR
+ };
+
+-static ssize_t getsmtp(int, char *);
++static int getsmtp(int, char *);
+
+ int
+ main(int argc, char *argv[])
+ {
+- ssize_t rc;
+- int conn, smtp_state;
++ int rc, conn, smtp_state;
+ FILE *f;
+ const char *xoauth = getenv("XOAUTH");
+ const char *smtputf8 = getenv("SMTPUTF8");
+@@ -74,8 +73,8 @@ main(int argc, char *argv[])
+ if (rc == -1)
+ break; /* EOF */
+
+- fwrite(line, rc, 1, f);
+- fwrite("\n", 1, 1, f);
++ fputs(line, f);
++ putc('\n', f);
+
+ switch (smtp_state) {
+ case SMTP_DATA: