- we fast forward to the next '-' since every mime boundary starts with '-'
- from a '-' we check thorough whether at this point we can find the searched boundary
Thanks to cirrus for pointing me to memchr()
if (pptr < content_end)
ptr = pptr;
}
+
+
next_boundary = NULL;
- for (srch=ptr; srch<content_end; ++srch) {
+ for (srch=ptr;
+ (srch != NULL) && (srch < content_end);
+ srch = memchr(srch, '-', content_end - srch))
+ {
if (!memcmp(srch,
m->b[startary].Key,
m->b[startary].len))
next_boundary = srch;
srch = content_end;
}
+ else srch ++;
+
}
}