3 ms·
Whatever implements string.h on your system, and other functions dealing with string input. Some of these functions simply shouldn't be used at all. An extreme
by dvfjsdhgfv 6y ago
Whatever implements string.h on your system, and other functions dealing with string input. Some of these functions simply shouldn't be used at all. An extreme case is gets() that was phased out, but many others are no better.
- saagarjha 6y agoThe string functions in your system are almost certainly less buggy than anything you’re going to write.
- dvfjsdhgfv 6y agoYou'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().