mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 11:19:51 +02:00
More unnecessary string duplication
This commit is contained in:
@@ -121,7 +121,7 @@ void Client::Initialise(std::string proxyString)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(proxyString.length())
|
if(proxyString.length())
|
||||||
http_init(proxyString.c_str());
|
http_init((char*)proxyString.c_str());
|
||||||
else
|
else
|
||||||
http_init(NULL);
|
http_init(NULL);
|
||||||
|
|
||||||
@@ -411,12 +411,7 @@ void Client::SetProxy(std::string proxy)
|
|||||||
{
|
{
|
||||||
http_done();
|
http_done();
|
||||||
if(proxy.length())
|
if(proxy.length())
|
||||||
{
|
http_init((char*)proxy.c_str());
|
||||||
char *tempproxy = new char[proxy.length() + 1];
|
|
||||||
std::strcpy (tempproxy, proxy.c_str());
|
|
||||||
http_init(tempproxy);
|
|
||||||
delete[] tempproxy;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
http_init(NULL);
|
http_init(NULL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user