mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-31 12:31:32 +08:00
fix: removed a warning
This commit is contained in:
parent
3b4b7812bf
commit
bb916aa999
1 changed files with 1 additions and 2 deletions
|
@ -1167,7 +1167,7 @@ int CmdHF14AMfNestedHard(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int randInRange(int min, int max) {
|
int randInRange(int min, int max) {
|
||||||
return min + (int) (rand() / (double) (RAND_MAX + 1) * (max - min + 1));
|
return min + (int) (rand() / (double) (RAND_MAX) * (max - min + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fisher–Yates shuffle
|
//Fisher–Yates shuffle
|
||||||
|
@ -1177,7 +1177,6 @@ void shuffle( uint8_t *array, uint16_t len) {
|
||||||
time_t t;
|
time_t t;
|
||||||
srand((unsigned) time(&t));
|
srand((unsigned) time(&t));
|
||||||
while (len) {
|
while (len) {
|
||||||
//x = randInRange(0, len) * (len-- *6) | 0; // 0 = i < n
|
|
||||||
x = randInRange(0, (len -= 6) ) | 0; // 0 = i < n
|
x = randInRange(0, (len -= 6) ) | 0; // 0 = i < n
|
||||||
x %= 6;
|
x %= 6;
|
||||||
memcpy(tmp, array + x, 6);
|
memcpy(tmp, array + x, 6);
|
||||||
|
|
Loading…
Reference in a new issue