mirror of
https://github.com/leahneukirchen/mblaze
synced 2024-11-07 15:20:37 +00:00
mmime: gen_qp: quote ^From and ^.$ to be safe
This commit is contained in:
parent
54435b30b6
commit
d4cbac0aa5
6
mmime.c
6
mmime.c
@ -85,7 +85,11 @@ int gen_qp(uint8_t *s, off_t size, int maxlinelen, int linelen)
|
||||
}
|
||||
|
||||
if ((s[i] > 126) ||
|
||||
(s[i] == '=')) {
|
||||
(s[i] == '=') ||
|
||||
(linelen == 0 &&
|
||||
(strncmp((char *)s, "From ", 5) == 0 ||
|
||||
(s[i] == '.' && i+1 < size &&
|
||||
(s[i+1] == '\n' || s[i+1] == '\r'))))) {
|
||||
printf("=%02X", s[i]);
|
||||
linelen += 3;
|
||||
prev = s[i];
|
||||
|
Loading…
Reference in New Issue
Block a user