From 5fa9a7a7066cce6f660a97790a160942db2b299a Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 23 Apr 2019 12:35:12 +0200 Subject: mmime: gen_file: remove check for trailing newline for 7bit transfer RFC2046 5.1.1 specifies that parts without trailing newlines are coded without problems: > NOTE: The CRLF preceding the boundary delimiter line is conceptually > attached to the boundary so that it is possible to have a part that > does not end with a CRLF (line break). This if-statement now also codes empty files correctly. --- mmime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mmime.c') diff --git a/mmime.c b/mmime.c index 6188f5b..79e1ef0 100644 --- a/mmime.c +++ b/mmime.c @@ -246,7 +246,7 @@ gen_file(char *file, char *ct) } if (bitlow == 0 && bithigh == 0 && - maxlinelen <= 78 && content[size-1] == '\n') { + maxlinelen <= 78) { if (!ct) ct = "text/plain"; printf("Content-Type: %s\n", ct); -- cgit 1.4.1