Annotation of researchv10no/libc/stdio/ostdio/sprintf.c, revision 1.1

1.1     ! root        1: /* @(#)sprintf.c       4.1 (Berkeley) 12/21/80 */
        !             2: #include       <stdio.h>
        !             3: 
        !             4: int
        !             5: sprintf(str, fmt, args)
        !             6: char *str, *fmt;
        !             7: {
        !             8:        struct _iobuf _strbuf;
        !             9:        register int n;
        !            10: 
        !            11:        _strbuf._flag = _IOWRT+_IOSTRG;
        !            12:        _strbuf._ptr = (unsigned char *) str;
        !            13:        _strbuf._cnt = 32767;
        !            14:        n = _doprnt(fmt, &args, &_strbuf);
        !            15:        putc('\0', &_strbuf);
        !            16:        return(n);
        !            17: }
        !            18: 
        !            19: int
        !            20: snprintf(str, len, fmt, args)
        !            21: char *str, *fmt;
        !            22: {
        !            23:        struct _iobuf _strbuf;
        !            24:        register int n;
        !            25: 
        !            26:        _strbuf._flag = _IOWRT+_IOSTRG;
        !            27:        _strbuf._ptr = (unsigned char *) str;
        !            28:        _strbuf._cnt = len;
        !            29:        n = _doprnt(fmt, &args, &_strbuf);
        !            30:        putc('\0', &_strbuf);
        !            31:        return(n);
        !            32: }

unix.superglobalmegacorp.com

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