aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 f8b5b2c..b46fb06 100644
--- a/src/string/strfry.c
+++ b/src/string/strfry.c
@@ -40,7 +40,7 @@ char* strfry(char* anagram)
char t;
if (anagram == NULL)
return NULL;
- for (i = strlen(anagram); i; i--)
+ for (i = strlen(anagram) - 1; i; i--)
{
r = rand();
j = (size_t)((double)r / ((double)RAND_MAX + 1) * (double)i); /* TODO This is not uniformally random. */