mirror of
https://github.com/facebook/zstd.git
synced 2025-11-29 00:04:37 -05:00
Fix generating 1 too few characters in random string generator
This commit is contained in:
parent
5b0c8f0a7c
commit
c502cd33e5
@ -59,7 +59,6 @@ static char *generatePseudoRandomString(char *str, size_t size) {
|
||||
const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJK1234567890!@#$^&*()_";
|
||||
uint32_t seed = 0;
|
||||
if (size) {
|
||||
--size;
|
||||
for (size_t n = 0; n < size; n++) {
|
||||
int key = FUZZ_RDG_rand(&seed) % (int) (sizeof charset - 1);
|
||||
str[n] = charset[key];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user