3 ms·
You're kidding, right? We're not talking about the implementation, but the design. If I ever wanted to write a gets() replacement, it would definitely have prop
by dvfjsdhgfv 6y ago
You're kidding, right? We're not talking about the implementation, but the design. If I ever wanted to write a gets() replacement, it would definitely have proper checks in place to prevent buffer overflow. Everyone using strcpy() is playing with fire. You'll get it right 9 times and make a mistake the 10th time. It's not that the people who implemented these functions are stupid, but they were designed in different times for other types of environments.
- creata 6y ago> probably with less bugs than the standard one… We're not talking about the implementation, but the design. That's not how most people use the word "bug".
- dvfjsdhgfv 6y agoLiterally from the man page of gets(): BUGS: Never use gets().