Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Taylor <outtatime@gmail.com>2016-10-09 20:17:07 +0300
committerrofl0r <retnyg@gmx.net>2016-10-15 00:49:01 +0300
commit0f6b226b15dcef4105948c3ea16ac900ead18441 (patch)
tree530a23bc6efc49b5671ec882147f96bf25173fea
parent260578d00e5e96a1bee217ad2dd97e75d5c1f190 (diff)
Fix random_chain on Mac OS X
On Mac OS X, random chain was broken and returned always the last proxy from the config file. Use fix as suggested by @ravomavain. Closes #75.
-rw-r--r--src/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index ea6417f..b529f57 100644
--- a/src/core.c
+++ b/src/core.c
@@ -464,7 +464,7 @@ static proxy_data *select_proxy(select_type how, proxy_data * pd, unsigned int p
case RANDOMLY:
do {
k++;
- i = 0 + (unsigned int) (proxy_count * 1.0 * rand() / (RAND_MAX + 1.0));
+ i = rand() % proxy_count;
} while(pd[i].ps != PLAY_STATE && k < proxy_count * 100);
break;
case FIFOLY: