gets
Krzysztof G. Baranowski
kgb w manjak.knm.org.pl
Nie, 20 Gru 1998, 16:47:30 CET
On Sun, 20 Dec 1998, Artur Frysiak wrote:
> Jak prosto zastąpić gets ? Jestem na najlepszej drodze by skończyć
> ispell'a, ale dostaje podczas komplikacji (: ostrzerzenie, że gets jest
> niebezpieczne i nie powinno być używane. Jeśli nikt nie odpowie wystawie
> takiego jak jest, ale to jest potencjalny overrun.
man gets -> przeczytaj sekcje BUGS, ewentualnie
info -f libc -> File: libc.info, Node: Line Input, Next: Unreading,
Prev: Character Input, \Up: I/O on Streams
Cytuje:
- Deprecated function: char * gets (char *S)
[...]
*Warning:* The `gets' function is *very dangerous* because it
provides no protection against overflowing the string S. The GNU
library includes it for compatibility only. You should *always*
use `fgets' or `getline' instead. To remind you of this, the
linker (if using GNU `ld') will issue a warning whenever you use
`gets'.
HTH,
Kris
--
Krzysztof G. Baranowski - Prezes Klubu Nieszkodliwych Manjaków
"Smith & Wesson - The original point and click interface..."
http://www.knm.org.pl/ <prezes w manjak.knm.org.pl>
Więcej informacji o liście dyskusyjnej pld-devel-pl