aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-05-27 17:38:28 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-05-27 17:38:28 +0200
commit63006f6f641322058198cd3527f58817b938db43 (patch)
treee39e3241fd5c0641ad16f0549eccddf79e1f4225
parentb45b0560d748ff02f525665f590e5cd605f289d3 (diff)
downloadmblaze-63006f6f641322058198cd3527f58817b938db43.tar.gz
blaze822_mime2231_parameter: fix lookup and parsing of non-2231 fields
-rw-r--r--rfc2231.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rfc2231.c b/rfc2231.c
index d700c77..85cf629 100644
--- a/rfc2231.c
+++ b/rfc2231.c
@@ -35,7 +35,7 @@ blaze822_mime2231_parameter(char *s, char *name,
i = 100;
goto found_extended;
}
- if (blaze822_mime_parameter(s, namenum, &sbuf, &ebuf)) {
+ if (blaze822_mime_parameter(s, name, &sbuf, &ebuf)) {
i = 100;
goto found_plain;
}
@@ -75,11 +75,11 @@ found_extended:
}
*dst = 0;
} else {
- namenum[strlen(namenum) - 1] = 0;
+ namenum[strlen(namenum) - 1] = 0; // strip last *
if (blaze822_mime_parameter(s, namenum, &sbuf, &ebuf)) {
found_plain:
// copy plain
- if (dstend - dst < ebuf - sbuf) {
+ if (ebuf - sbuf < dstend - dst) {
memcpy(dst, sbuf, ebuf - sbuf);
dst += ebuf - sbuf;
}