> The strfry() function randomizes the contents of string by using rand(3) to randomly swap characters in the string. The result is an anagram of string.
It doesn't even say that every permutation can be produced. So the code is already compliant to the spec.
The difference with the memcpy issue is that nobody is really using strfry, especially nobody expecting an uniform permutation (rand() has ridiculously little entropy, and the space of permutations is huge).
Still, put in context this bug report is very funny :)
> The strfry() function randomizes the contents of string by using rand(3) to randomly swap characters in the string. The result is an anagram of string.
It doesn't even say that every permutation can be produced. So the code is already compliant to the spec.
The difference with the memcpy issue is that nobody is really using strfry, especially nobody expecting an uniform permutation (rand() has ridiculously little entropy, and the space of permutations is huge).
Still, put in context this bug report is very funny :)