Pristine Ack-5.5
[Ack-5.5.git] / modules / src / alloc / Realloc.c
1 /* $Id: Realloc.c,v 1.8 1994/06/24 11:06:27 ceriel Exp $ */
2 /*
3  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4  * See the copyright notice in the ACK home directory, in the file "Copyright".
5  */
6 /*      M E M O R Y  A L L O C A T I O N  R O U T I N E S       */
7
8 /*      The memory allocation routines offered in this file are:
9
10         char *Realloc(ptr, n)   : reallocate buffer to n bytes
11 */
12
13 #if __STDC__
14 #include <stdlib.h>
15 #else
16 extern char *malloc();
17 extern char *realloc();
18 #endif
19
20 #include        "alloc.h"
21
22 char *
23 Realloc(ptr, sz)
24         char ptr[];
25         unsigned int sz;
26 {
27         register char *mptr;
28
29         if (!ptr) mptr = malloc(sz);
30         else mptr = realloc(ptr, sz);
31         if (sz && mptr == 0) No_Mem();
32         return mptr;
33 }