Annotation of researchv10no/libc/stdio/gets.c-1, revision 1.1

1.1     ! root        1: /* @(#)gets.c  4.1 (Berkeley) 12/21/80 */
        !             2: /*
        !             3:  * Deleted from libc.a by td, 88.11.07
        !             4:  * gets is an unacceptable security hole.
        !             5:  */
        !             6: #include       <stdio.h>
        !             7: 
        !             8: char *
        !             9: gets(s)
        !            10: char *s;
        !            11: {
        !            12:        register c;
        !            13:        register char *cs;
        !            14: 
        !            15:        cs = s;
        !            16:        while ((c = getchar()) != '\n' && c >= 0)
        !            17:                *cs++ = c;
        !            18:        if (c<0 && cs==s)
        !            19:                return(NULL);
        !            20:        *cs++ = '\0';
        !            21:        return(s);
        !            22: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.