{
return;
}
- for (; len--;)
+ uint16_t i, rand_idx;
+ uint8_t *loc;
+ i = len;
+ loc = location;
+ for (; i--;)
{
- *location++ = OCGetRandomByte();
+ *loc++ = OCGetRandomByte();
+ }
+ uint8_t temp;
+ i = len;
+ while(i > 1)
+ {
+ rand_idx = lrand48() % i;
+ temp = location[i - 1];
+ location[i - 1] = location[rand_idx];
+ location[rand_idx] = temp;
+ i--;
}
}