Commit c3f44eed authored by Mathieu STEFANI's avatar Mathieu STEFANI

MIME parsing: used memchr instead of strchr

parent bb9909a2
...@@ -75,7 +75,7 @@ MediaType::parseRaw(const char* str, size_t len) { ...@@ -75,7 +75,7 @@ MediaType::parseRaw(const char* str, size_t len) {
#define MAX_SIZE(s) std::min(sizeof(s) - 1, len - offset(p)) #define MAX_SIZE(s) std::min(sizeof(s) - 1, len - offset(p))
// Parse type // Parse type
const char *p = strchr(str, '/'); const char *p = static_cast<const char *>(memchr(str, '/', len));
if (p == NULL) { if (p == NULL) {
raise("Malformated Media Type"); raise("Malformated Media Type");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment