diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2015-07-07 21:29:31 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2015-07-07 21:29:31 +0200 |
| commit | 9254e045c63c401457c51729d21aa9921e6b2f80 (patch) | |
| tree | 3eb6862cc0ac91f1241921285af47ba941dbba49 | |
| parent | 67516a61caf036798e83ea9287a1095f156ad894 (diff) | |
Remove warning about jump depending on garbage value in last
| -rw-r--r-- | src/multipart_formdata_parser.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/multipart_formdata_parser.cc b/src/multipart_formdata_parser.cc index 6802bc8..e46b9e3 100644 --- a/src/multipart_formdata_parser.cc +++ b/src/multipart_formdata_parser.cc @@ -32,11 +32,11 @@ Iterator find_boundary(Iterator begin, Iterator end, continue; } ++test; - if (static_cast<size_t>(end - test) <= boundary.size()) return end; + if (static_cast<size_t>(end - test) <= boundary.size()) break; if (boundary.compare(0, std::string::npos, &(*test), boundary.size()) == 0) { test += boundary.size(); - if (test == end) return end; + if (test == end) break; if (*test == '-') { ++test; if (test == end || *test != '-') continue; @@ -50,6 +50,7 @@ Iterator find_boundary(Iterator begin, Iterator end, } } } + *last = true; return end; } |
