aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-16 01:24:46 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-16 01:24:46 +0100
commit76f2278916ff8baec5f023e72237baca7e81f762 (patch)
treea03eef02a85a1f0cbb20876ff6f9f618a50325f6
parentupdate todo: host endian to network endian, and network endian to host endian, conversion functions for 64-bits. (diff)
downloadslibc-76f2278916ff8baec5f023e72237baca7e81f762.tar.gz
slibc-76f2278916ff8baec5f023e72237baca7e81f762.tar.bz2
slibc-76f2278916ff8baec5f023e72237baca7e81f762.tar.xz
fix issue #5 on github
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-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 ac8ef13..bced7ce 100644
--- a/src/string/strfry.c
+++ b/src/string/strfry.c
@@ -43,7 +43,7 @@ char* strfry(char* anagram)
for (i = strlen(anagram); --i;)
{
r = rand();
- j = (size_t)((double)r / (RAND_MAX + 1) * (double)i);
+ j = (size_t)((double)r / ((double)RAND_MAX + 1) * (double)i);
t = anagram[i], anagram[i] = anagram[j], anagram[j] = t;
}
return anagram;