dos_compilers/Mix Power C v1/MEMORY.C
2024-07-01 15:26:34 -07:00

22 lines
456 B
C

/* Copyright (c) Mix Software 1988 */
char *realloc(oldptr, newsize)
char *oldptr;
int newsize;
{
char *newptr, *malloc();
if (oldptr == NULL) return malloc(newsize);
if (newsize == 0) {
free(newptr);
return NULL;
}
if (newptr = malloc(newsize)) {
if (oldptr == NULL) return newptr;
memcpy(newptr, oldptr, newsize);
free(oldptr);
return newptr;
}
else return NULL;
}