Added algorithm include, fixed off-by-one error in http::get_parameter()
This commit is contained in:
parent
75841d87a4
commit
9ff1cc0acf
@ -15,12 +15,12 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include "libravatarserv.hpp"
|
||||
|
||||
using std::cout;
|
||||
using std::cerr;
|
||||
using global::avatar_dir;
|
||||
using namespace http;
|
||||
|
||||
const Request http::parse_request(const string &request)
|
||||
@ -74,7 +74,7 @@ const string http::get_parameter(const string &request, const string ¶meter)
|
||||
std::size_t pos = request.find(parameter + "=");
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
pos += parameter.length();
|
||||
pos += (1 + parameter.length());
|
||||
return request.substr(pos, request.find('&', pos));
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <basedir.h>
|
||||
#include "version.hpp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user