forked from tastytea/libravatarserv
Bugfix: Re-used a variable that I shouldn't have reused.
This commit is contained in:
parent
74da3609fc
commit
7f87ab969c
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.2)
|
||||
project(libravatarserv
|
||||
VERSION 0.2.1
|
||||
VERSION 0.2.2
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
|
|
@ -61,16 +61,16 @@ int main()
|
|||
uint16_t size = 80;
|
||||
string digest = request.substr(8);
|
||||
std::transform(digest.begin(), digest.end(), digest.begin(), ::tolower);
|
||||
std::size_t pos = digest.find('?');
|
||||
if (pos != std::string::npos)
|
||||
std::size_t pos_digest = digest.find('?');
|
||||
if (pos_digest != std::string::npos)
|
||||
{
|
||||
pos = digest.find("s=", pos);
|
||||
if (pos != std::string::npos)
|
||||
std::size_t pos_size = digest.find("s=", pos_digest);
|
||||
if (pos_size != std::string::npos)
|
||||
{
|
||||
size = static_cast<uint16_t>(std::stoul(digest.substr(pos + 2)));
|
||||
size = static_cast<uint16_t>(std::stoul(digest.substr(pos_size + 2)));
|
||||
cout << size << endl;
|
||||
}
|
||||
digest = digest.substr(0, pos);
|
||||
digest = digest.substr(0, pos_digest);
|
||||
}
|
||||
|
||||
image::Image answer = image::get(digest, size);
|
||||
|
|
Loading…
Reference in New Issue
Block a user