aboutsummaryrefslogtreecommitdiffstats
path: root/src/string
diff options
context:
space:
mode:
Diffstat (limited to 'src/string')
-rw-r--r--src/string/strfry.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/strfry.c b/src/string/strfry.c
index cf8d643..da6d0ac 100644
--- a/src/string/strfry.c
+++ b/src/string/strfry.c
@@ -41,7 +41,7 @@ char* strfry(char* anagram)
for (i = strlen(anagram); --i;)
{
r = rand();
- j = (int)((double)r / (RAND_MAX + 1));
+ j = (size_t)((double)r / (RAND_MAX + 1) * (double)i);
t = anagram[i], anagram[i] = anagram[j], anagram[j] = t;
}
return anagram;