aboutsummaryrefslogtreecommitdiff
path: root/blaze822.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-21 20:37:10 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-21 20:37:10 +0200
commitac679b264c05b65945dc9c0aa84f721785d9a1f2 (patch)
treea684bcfb0ae4b7e7e543856407a44b26a1304f8c /blaze822.c
parent87d21351046ef625231e0d7f0bf8301b42551cb6 (diff)
downloadmblaze-ac679b264c05b65945dc9c0aa84f721785d9a1f2.tar.gz
blaze822: fix header finding with CRLF
Diffstat (limited to 'blaze822.c')
-rw-r--r--blaze822.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/blaze822.c b/blaze822.c
index 66137e0..1011d29 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -344,9 +344,12 @@ blaze822(char *file)
return 0;
}
- if ((end = memmem(buf-overlap+used, rd+overlap, "\n\n", 2)) ||
- (end = memmem(buf-overlap+used, rd+overlap, "\r\n\r\n", 4))) {
- used += rd;
+ if ((end = memmem(buf-overlap+used, rd+overlap, "\n\n", 2))) {
+ end++;
+ break;
+ }
+ if ((end = memmem(buf-overlap+used, rd+overlap, "\r\n\r\n", 4))) {
+ end++;
end++;
break;
}