Added algorithm include, fixed off-by-one error in http::get_parameter()

This commit is contained in:
tastytea 2018-11-26 04:27:11 +01:00
parent 75841d87a4
commit 9ff1cc0acf
Signed by untrusted user: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 2 additions and 3 deletions

View File

@ -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 &parameter)
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));
}

View File

@ -15,7 +15,6 @@
*/
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <basedir.h>
#include "version.hpp"