Created
October 26, 2017 05:46
-
-
Save yui0/75bd24be069b9a6ac3b6149615bda4db to your computer and use it in GitHub Desktop.
recalloc function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void *recalloc(void *p, int s, int ss) | |
{ | |
void *r = calloc(ss, 1); | |
if (!r) return 0; | |
memcpy(r, p, s); | |
free(p); | |
return r; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment