|
@@ -230,11 +230,11 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx,
|
|
|
*/
|
|
*/
|
|
|
if (byte_count < DEFAULT_BLK_SZ) {
|
|
if (byte_count < DEFAULT_BLK_SZ) {
|
|
|
empty_rbuf:
|
|
empty_rbuf:
|
|
|
- for (; ctx->rand_data_valid < DEFAULT_BLK_SZ;
|
|
|
|
|
- ctx->rand_data_valid++) {
|
|
|
|
|
|
|
+ while (ctx->rand_data_valid < DEFAULT_BLK_SZ) {
|
|
|
*ptr = ctx->rand_data[ctx->rand_data_valid];
|
|
*ptr = ctx->rand_data[ctx->rand_data_valid];
|
|
|
ptr++;
|
|
ptr++;
|
|
|
byte_count--;
|
|
byte_count--;
|
|
|
|
|
+ ctx->rand_data_valid++;
|
|
|
if (byte_count == 0)
|
|
if (byte_count == 0)
|
|
|
goto done;
|
|
goto done;
|
|
|
}
|
|
}
|