elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
libc
/
malloc
/
calloc.c
File editor
#include <errno.h> #include <malloc.h> #include <string.h> void * calloc(size_t elm, size_t sz) { unsigned int v; void *ptr; #ifdef __GNUC__ if (__builtin_umul_overflow(elm, sz, &v)) { errno = ENOMEM; return 0; } #else v = elm * sz; if (sz != 0 && v / sz != elm) { errno = ENOMEM; return 0; } #endif ptr = malloc(v); if (ptr) memset(ptr, 0, v); return ptr; }
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history