From 575aa1a0e4f91a64e8bc4f2cce31d96f57078ab8 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Thu, 5 Oct 2017 13:17:31 +0200 Subject: [PATCH] ccminer: argument fix for 10th device selection --- ccminer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ccminer.cpp b/ccminer.cpp index 41db279..12f61ec 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -3593,10 +3593,10 @@ void parse_arg(int key, char *arg) { int device_thr[MAX_GPUS] = { 0 }; int ngpus = cuda_num_devices(); - char * pch = strtok (arg,","); + char* pch = strtok(arg,","); opt_n_threads = 0; while (pch != NULL && opt_n_threads < MAX_GPUS) { - if (pch[0] >= '0' && pch[0] <= '9' && pch[1] == '\0') + if (pch[0] >= '0' && pch[0] <= '9' && strlen(pch) <= 2) { if (atoi(pch) < ngpus) device_map[opt_n_threads++] = atoi(pch);