Annotation of coherent/b/lib/libc/gen/malloc/calloc.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * C general utilities library.
                      3:  * calloc()
                      4:  * ANSI 4.10.3.1.
                      5:  * Allocate and clear.
                      6:  */
                      7: 
                      8: #include <stdlib.h>
                      9: #include <string.h>
                     10: 
                     11: __VOID__ *
                     12: calloc(nmemb, size) size_t nmemb; register size_t size;
                     13: {
                     14:        register __VOID__ *bp;
                     15:        long lsize;
                     16: 
                     17:        lsize = (long)size * nmemb;
                     18:        size *= nmemb;
                     19:        if (lsize != (long)size)
                     20:                return (__VOID__ *)NULL;
                     21:        if ((bp = malloc(size)) != NULL)
                     22:                memset(bp, 0, size);
                     23:        return bp;
                     24: }
                     25: 
                     26: /* end of calloc.c */

unix.superglobalmegacorp.com

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