1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fix warnings

This commit is contained in:
Vladislav Vaintroub
2016-09-09 20:22:38 +00:00
parent 2157642849
commit 895b2eb91d
2 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ char *rand_str(size_t length) {
char *dest= (char *)malloc(length+1);
char *p= dest;
while (length-- > 0) {
size_t index = (double) rand() / RAND_MAX * (sizeof charset - 1);
size_t index = (size_t)((double)rand() / RAND_MAX * (sizeof charset - 1));
*dest++ = charset[index];
}
*dest = '\0';