diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-05-10 06:44:30 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-05-10 06:44:30 +0000 |
commit | 96bad006f14ac46ca7a59dc4c5ba5ed9ef7a1560 (patch) | |
tree | 9e209798f73466fb9622bf0a9b14f4fabf00eb29 /string/strfry.c | |
parent | 2a0a747e57ec96bab9d4a6b7c0b32df82a41316e (diff) |
Updated to fedora-glibc-20070510T0634cvs/fedora-glibc-2_5_90-23
Diffstat (limited to 'string/strfry.c')
-rw-r--r-- | string/strfry.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/string/strfry.c b/string/strfry.c index 112dd4adb3..a8b202d176 100644 --- a/string/strfry.c +++ b/string/strfry.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1996, 1999, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1996, 1999, 2002, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,16 +37,14 @@ strfry (char *string) init = 1; } - len = strlen (string); + len = strlen (string) - 1; for (i = 0; i < len; ++i) { int32_t j; - char c; - __random_r (&rdata, &j); - j %= len; + j = j % len + 1; - c = string[i]; + char c = string[i]; string[i] = string[j]; string[j] = c; } |