retiring gets(3)

David Chase chase at Ozona.orc.olivetti.com
Thu Nov 10 05:07:19 AEST 1988


You should also consider retiring certain features of 'scanf' and
'fscanf'.  A call along the lines of

    scanf("%s", junk);

is perfectly able to scribble past the end of 'junk'.  I'm not sure if
there are other holes like this built in to the standard i/o library;
it wouldn't hurt to check.  (I've never been a real fan of 'scanf',
but it does seem marginally more useful and harder to replace than
'gets').

David



More information about the Comp.lang.c mailing list