mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-17 16:27:44 +00:00
Fix --cpu-affinity overflow.
This commit is contained in:
parent
faf793b0aa
commit
f36b5eeaad
1 changed files with 1 additions and 7 deletions
|
@ -231,7 +231,6 @@ bool Options::parseArg(int key, char *arg)
|
|||
{
|
||||
char *p;
|
||||
int v;
|
||||
uint64_t ul;
|
||||
Url *url;
|
||||
|
||||
switch (key) {
|
||||
|
@ -357,12 +356,7 @@ bool Options::parseArg(int key, char *arg)
|
|||
|
||||
case 1020: /* --cpu-affinity */
|
||||
p = strstr(arg, "0x");
|
||||
ul = p ? strtoul(p, NULL, 16) : atol(arg);
|
||||
if (ul > (1UL << Cpu::threads()) -1) {
|
||||
ul = -1;
|
||||
}
|
||||
|
||||
m_affinity = ul;
|
||||
m_affinity = p ? strtoull(p, nullptr, 16) : strtoull(arg, nullptr, 10);
|
||||
break;
|
||||
|
||||
case 1002: /* --no-color */
|
||||
|
|
Loading…
Reference in a new issue