Sync changes with proxy.

This commit is contained in:
XMRig 2018-04-30 18:17:07 +07:00
parent 2b0309e159
commit 9c23186172
3 changed files with 33 additions and 28 deletions

View file

@ -123,6 +123,11 @@ void xmrig::Algorithm::parseAlgorithm(const char *algo)
m_algo = INVALID_ALGO;
m_variant = VARIANT_AUTO;
assert(algo != nullptr);
if (algo == nullptr) {
return;
}
for (size_t i = 0; i < ARRAY_SIZE(algorithms); i++) {
if ((strcasecmp(algo, algorithms[i].name) == 0) || (strcasecmp(algo, algorithms[i].shortName) == 0)) {
m_algo = algorithms[i].algo;
@ -182,6 +187,11 @@ void xmrig::Algorithm::parseXmrStakAlgorithm(const char *algo)
m_algo = INVALID_ALGO;
m_variant = VARIANT_AUTO;
assert(algo != nullptr);
if (algo == nullptr) {
return;
}
for (size_t i = 0; i < ARRAY_SIZE(xmrStakAlgorithms); i++) {
if (strcasecmp(algo, xmrStakAlgorithms[i].name) == 0) {
m_algo = xmrStakAlgorithms[i].algo;