Wait, the introduction to that page is misleading. They say "turn it into garbage" and "destroying string data", except it's not garbage, it's just an anagram... it just randomly swaps the characters around inside the string. Now, that in itself is not useless, but the comments on the function are really really misleading. From the description, I was expecting the contents of the string to be entirely replaced by psuedorandom data.
Well, I also thought maybe I was getting rusty by not knowing it -- but then I read the bit that said it's specific to the GNU C library. I'm comfortable that my C knowledge ain't that rusty now :)
Comments
Wait, the introduction to that page is misleading. They say "turn it into garbage" and "destroying string data", except it's not garbage, it's just an anagram... it just randomly swaps the characters around inside the string. Now, that in itself is not useless, but the comments on the function are really really misleading. From the description, I was expecting the contents of the string to be entirely replaced by psuedorandom data.
Should be renamed strscramble.
Just program a large app that pushes around lots of C strings, they'll get scrambled up sooner or later.
Well, I also thought maybe I was getting rusty by not knowing it -- but then I read the bit that said it's specific to the GNU C library. I'm comfortable that my C knowledge ain't that rusty now :)
Add a comment: