| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | c |
On 29 Dec 95 13:51, Paul Edwards wrote to Kieran Haughey: Hi Paul, KH>> Yes, but isn't gets() taking from the stdin anyway?.... so either way KH>> fgets(buffer,100,stdin); would be roughly the same as gets(buffer); except KH>> for lengths... but thinking about it I would prefer fgets, because as you KH>> said I can limit input :).. PE> That is the only point - safety. The only time you should use PE> something like gets is when you can guarantee that the strings PE> entered won't be bigger than the internal buffer, because you PE> know the content of the data, because it is computer generated. PE> And if it's computer-generated data, it's a bit suspicious that PE> it's coming from stdin, which normally represents user input! Ah.. I never thought about the possibility of stdin not being from the keyboard :).. KH>> Thanx, I have never seen anyone elsewhere being warned about this, so I KH>> would have continued to use that dangerous little command :)..* Origin: -=> The Last Stand Against Sanity <=- (3:711/413.17) SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 420 423 430 510 808 809 SEEN-BY: 711/932 934 712/515 713/888 714/906 800/1 7877/2809 @PATH: 711/413 808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.