summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-12-06 21:07:35 +0000
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-12-06 22:21:48 +0100
commit56c84e942ad369d5bcd297ccaa130742b5562c33 (patch)
tree1ee3cc4690bcd56850cbb8e5282a2da4cb80eb46
parent350cfbc461fc6023b3232537cbf71bc18a85d07f (diff)
downloadxmr-stak-56c84e942ad369d5bcd297ccaa130742b5562c33.zip
xmr-stak-56c84e942ad369d5bcd297ccaa130742b5562c33.tar.gz
Fix const bug
-rw-r--r--xmrstak/cli/cli-miner.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp
index 1298b60..031b1b1 100644
--- a/xmrstak/cli/cli-miner.cpp
+++ b/xmrstak/cli/cli-miner.cpp
@@ -280,8 +280,9 @@ void do_guided_config(bool userSetPasswd)
* - author: Cody Gray
* - date: Feb 4 '11
*/
-void UACDialog(const std::string& binaryName, const std::string& args)
+void UACDialog(const std::string& binaryName, std::string& args)
{
+ args += " --noUAC";
SHELLEXECUTEINFO shExInfo = {0};
shExInfo.cbSize = sizeof(shExInfo);
shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
@@ -289,11 +290,11 @@ void UACDialog(const std::string& binaryName, const std::string& args)
shExInfo.lpVerb = "runas";
shExInfo.lpFile = binaryName.c_str();
// disable UAC dialog (else the miner will go into a infinite loop)
- shExInfo.lpParameters = (args + " --noUAC").c_str();
+ shExInfo.lpParameters = args.c_str();
shExInfo.lpDirectory = 0;
shExInfo.nShow = SW_SHOW;
shExInfo.hInstApp = 0;
-
+
if(ShellExecuteEx(&shExInfo))
{
WaitForSingleObject(shExInfo.hProcess, INFINITE);
@@ -477,7 +478,11 @@ int main(int argc, char *argv[])
{
std::string minerArgs;
for(int i = 1; i < argc; i++)
- minerArgs += std::string(" ") + argv[i];
+ {
+ minerArgs += " ";
+ minerArgs += argv[i];
+ }
+
UACDialog(argv[0], minerArgs);
}
#endif
OpenPOWER on IntegriCloud