diff options
Diffstat (limited to 'src/NetUtils.cpp')
-rw-r--r-- | src/NetUtils.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/NetUtils.cpp b/src/NetUtils.cpp index 0f957d5..9cf88c7 100644 --- a/src/NetUtils.cpp +++ b/src/NetUtils.cpp @@ -311,7 +311,7 @@ namespace QuickMedia { std::string result; string_split(header, '\n', [&type, &result](const char *str, size_t size) { while(size > 0 && (*str == ' ' || *str == '\t')) { ++str; --size; } - if(size < type.size() || strncasecmp(str, type.c_str(), type.size()) != 0 || size == type.size()) + if(size < type.size() || !strncase_equals(str, type.c_str(), type.size()) || size == type.size()) return true; str += type.size(); @@ -325,7 +325,9 @@ namespace QuickMedia { str += (colon_offset + 1); size -= (colon_offset + 1); + // lstrip space while(size > 0 && (*str == ' ' || *str == '\t')) { ++str; --size; } + // rstrip whitespace while(size > 0 && (str[size - 1] == ' ' || str[size - 1] == '\t' || str[size - 1] == '\r' || str[size - 1] == '\n')) { --size; } result.assign(str, size); |