From 11225d3b3202cc3a6a04eb92fd6f5f00a8354bbc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 1 Mar 2016 23:19:36 +0100 Subject: derp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/string/strfry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. */ -- cgit v1.2.3-70-g09d2