Annotation of /trunk/mkinitrd-magellan/klibc/usr/klibc/calloc.c
Parent Directory | Revision Log
Revision 532 -
(hide annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 262 byte(s)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 262 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | niro | 532 | /* |
2 | * calloc.c | ||
3 | */ | ||
4 | |||
5 | #include <stdlib.h> | ||
6 | #include <string.h> | ||
7 | |||
8 | /* FIXME: This should look for multiplication overflow */ | ||
9 | |||
10 | void *calloc(size_t nmemb, size_t size) | ||
11 | { | ||
12 | void *ptr; | ||
13 | |||
14 | size *= nmemb; | ||
15 | ptr = malloc(size); | ||
16 | if (ptr) | ||
17 | memset(ptr, 0, size); | ||
18 | |||
19 | return ptr; | ||
20 | } |