Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/modules/klibc/calloc.c

Source at commit 1295 created 12 years 8 months ago.
By meklort, Remove libsaio.h from klibc
1/*
2 * calloc.c
3 */
4
5#include <stdlib.h>
6#include <string.h>
7/* FIXME: This should look for multiplication overflow */
8
9void *calloc(size_t nmemb, size_t size)
10{
11void *ptr;
12
13size *= nmemb;
14ptr = malloc(size);
15if (ptr)
16memset(ptr, 0, size);
17
18return ptr;
19}
20

Archive Download this file

Revision: 1295