aboutsummaryrefslogtreecommitdiff
path: root/string/strfry.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/strfry.c')
-rw-r--r--string/strfry.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string/strfry.c b/string/strfry.c
index a8b202d176..d392d5526b 100644
--- a/string/strfry.c
+++ b/string/strfry.c
@@ -42,7 +42,7 @@ strfry (char *string)
{
int32_t j;
__random_r (&rdata, &j);
- j = j % len + 1;
+ j = j % (len - i) + i;
char c = string[i];
string[i] = string[j];