Removes some warnings by adding missing returns

This commit is contained in:
Felipe Zimmerle
2015-08-11 10:22:46 -03:00
parent c5a4355348
commit fb161a69a9
8 changed files with 20 additions and 19 deletions

View File

@@ -44,12 +44,11 @@ bool Multipart::init() {
}
std::size_t boundary_pos = m_header.find("boundary");
if (boundary_pos < 0) {
if (boundary_pos > 0 && m_header.find("boundary", boundary_pos) > 0) {
debug(4, "Multipart: Multiple boundary parameters in " \
"Content-Type.");
return false;
}
if (boundary_pos != std::string::npos &&
m_header.find("boundary", boundary_pos + 1) != std::string::npos) {
debug(4, "Multipart: Multiple boundary parameters in " \
"Content-Type.");
return false;
}
std::string boundary = m_header.c_str() + boundary_pos;

View File

@@ -70,6 +70,8 @@ bool MultipartBlob::processContent() {
offset = end + 1;
}
content = std::string(m_blob, offset, m_blob.length() - offset + 1);
return true;
}
@@ -123,6 +125,8 @@ bool MultipartBlob::processContentDispositionLine(
filename = std::string(dispositionLine, offset, end - offset);
}
}
return true;
}