Skip to content

Commit

Permalink
Simplify rand_str()function
Browse files Browse the repository at this point in the history
  • Loading branch information
vaintroub committed Sep 10, 2016
1 parent 1279753 commit 4ed1ca0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions unittest/libmariadb/bulk1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ char *rand_str(size_t length) {
char *dest= (char *)malloc(length+1);
char *p= dest;
while (length-- > 0) {
size_t index = (size_t)((double)rand() / RAND_MAX * (sizeof charset - 1));
*dest++ = charset[index];
*dest++ = charset[rand() % sizeof(charset)];
}
*dest = '\0';
return p;
Expand Down

0 comments on commit 4ed1ca0

Please sign in to comment.