aboutsummaryrefslogtreecommitdiff
path: root/lib/mime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mime.c')
-rw-r--r--lib/mime.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/mime.c b/lib/mime.c
index 9f3d40f1a..312094d7f 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -296,9 +296,12 @@ static char *escape_string(const char *src, size_t len)
for(i = 0; len; len--) {
char c = *src++;
- if(c == '"' || c == '\\' || !c)
+ if(c == '"' || c == '\\' || !c) {
dst[i++] = '\\';
- dst[i++] = c? c: '0';
+ if(!c)
+ c = '0';
+ }
+ dst[i++] = c;
}
dst[i] = '\0';