Skip to content

Instantly share code, notes, and snippets.

@yui0
Created October 26, 2017 05:46
Show Gist options
  • Save yui0/75bd24be069b9a6ac3b6149615bda4db to your computer and use it in GitHub Desktop.
Save yui0/75bd24be069b9a6ac3b6149615bda4db to your computer and use it in GitHub Desktop.
recalloc function
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