Annotation of 3BSD/libc/stdio/gets.c, revision 1.1

1.1     ! root        1: #include       <stdio.h>
        !             2: 
        !             3: char *
        !             4: gets(s)
        !             5: char *s;
        !             6: {
        !             7:        register c;
        !             8:        register char *cs;
        !             9: 
        !            10:        cs = s;
        !            11:        while ((c = getchar()) != '\n' && c >= 0)
        !            12:                *cs++ = c;
        !            13:        if (c<0 && cs==s)
        !            14:                return(NULL);
        !            15:        *cs++ = '\0';
        !            16:        return(s);
        !            17: }

unix.superglobalmegacorp.com

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