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
/
realloc.c
File editor
#include <malloc.h> #include <string.h> void *realloc(void *ptr, size_t size) { void *nptr; size_t osize; if (ptr == 0) return malloc(size); osize = malloc_usable_size(ptr); #if 0 if (size <= osize) return ptr; /* don't reallocate, do nothing */ #else if (size <= osize) osize = size; /* copy less bytes in memcpy below */ #endif nptr = malloc(size); if (nptr == 0) return 0; memcpy(nptr, ptr, osize); free(ptr); return nptr; }
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