gets

Artur Frysiak wiget w usa.net
Nie, 20 Gru 1998, 20:24:20 CET


[niedziela, 20 grudzień 1998], Krzysztof G. Baranowski napisał(a):

> 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'.

Ciekawe co stoi na przeszkodzie aby zdefiniować makro
#define gets(x) fgets(x,sizeof(x),stdin)

Wiget
-- 
  __    __ _            _
 / / /\ \ (_) __ _  ___| |_  @__mail:  Artur Frysiak
 \ \/  \/ / |/ _` |/ _ \ __|            Rudlice 10
  \  /\  /| | (_| |  __/ |_           98-311 Ostrowek
   \/  \/ |_|\__, |\___|\__|
             |___/           email:   Wiget w USA.net
PGP key: http://www.t17.ml.org/~wiget/pgp.key
Fingerprint16 = 70 DB E0 2D 12 AB C7 31  B6 58 B5 61 B3 98 B6 E6
-------------- następna część ---------
Załącznik, który nie był tekstem został usunięty...
Name: nie znany
Type: application/pgp-signature
Size: 366 bytes
Desc: nie znany
Url : /mailman/pipermail/pld-devel-pl/attachments/19981220/236d3d5e/attachment.bin


Więcej informacji o liście dyskusyjnej pld-devel-pl