summaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-19 21:42:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-19 21:42:49 +0000
commita9f583d9108cfcdc4973bc6374e0d078dbb868c9 (patch)
tree855950d10863706d6d311a3906fd3184aa4c4182 /src/libutil/str_util.c
parent1f426c42cc9f0d5b0f5b41ef96ee2e0275649888 (diff)
downloadrspamd-a9f583d9108cfcdc4973bc6374e0d078dbb868c9.tar.gz
rspamd-a9f583d9108cfcdc4973bc6374e0d078dbb868c9.zip
[Minor] Fix rfc2047 quoted printable version
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index c5df324b7..bccb0699f 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -1908,7 +1908,7 @@ decode:
if (end - o >= remain) {
processed = rspamd_memcspn (p, "=_", remain);
memcpy (o, p, processed);
- o += remain;
+ o += processed;
if (processed == remain) {
break;
@@ -1918,7 +1918,7 @@ decode:
remain -= processed;
p += processed;
- if (*p == '=') {
+ if (G_LIKELY (*p == '=')) {
p ++;
/* Skip comparison, as we know that we have found match */
goto decode;
@@ -1926,6 +1926,7 @@ decode:
else {
*o++ = ' ';
p ++;
+ remain --;
}
}
}