We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c80a7d commit abc484dCopy full SHA for abc484d
qtest.c
@@ -172,9 +172,12 @@ static void fill_rand_string(char *buf, size_t buf_size)
172
while (len < MIN_RANDSTR_LEN)
173
len = rand() % buf_size;
174
175
- randombytes((uint8_t *) buf, len);
+ uint64_t *randstr_buf_64 = malloc(len * sizeof(uint64_t));
176
+ randombytes((uint8_t *) randstr_buf_64, len * sizeof(uint64_t));
177
for (size_t n = 0; n < len; n++)
- buf[n] = charset[buf[n] % (sizeof(charset) - 1)];
178
+ buf[n] = charset[randstr_buf_64[n] % (sizeof(charset) - 1)];
179
+
180
+ free(randstr_buf_64);
181
buf[len] = '\0';
182
}
183
0 commit comments