Skip to content

Commit

Permalink
Simplify.
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wiz-0 committed Sep 23, 2023
1 parent c069bcd commit 8c632d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions regress/zip_read_file_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

void
randomize(char *buf, int count) {
const char *charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int charlen;
const char charset[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int i;
charlen = (int)strlen(charset);
srand(time(NULL));
for (i = 0; i < count; i++) {
buf[i] = charset[rand() % charlen];
buf[i] = charset[rand() % sizeof(charset)];
}
}

Expand Down
6 changes: 2 additions & 4 deletions regress/zip_write_encrypt_aes256_file_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

void
randomize(char *buf, int count) {
const char *charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int charlen;
const char charset[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int i;
charlen = (int)strlen(charset);
srand(time(NULL));
for (i = 0; i < count; i++) {
buf[i] = charset[rand() % charlen];
buf[i] = charset[rand() % sizeof(charset)];
}
}

Expand Down
6 changes: 2 additions & 4 deletions regress/zip_write_encrypt_pkware_file_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ different file types.

void
randomize(char *buf, int count) {
const char *charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int charlen;
const char charset[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int i;
charlen = (int)strlen(charset);
srand(time(NULL));
for (i = 0; i < count; i++) {
buf[i] = charset[rand() % charlen];
buf[i] = charset[rand() % sizeof(charset)];
}
}

Expand Down

0 comments on commit 8c632d6

Please sign in to comment.