1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-24 02:12:40 +00:00
Files
amiga-tz/ialloc.c

38 lines
624 B
C
Raw Normal View History

#ifdef OBJECTID
static char sccsid[] = "%W%";
#endif
/*LINTLIBRARY*/
#include "stdio.h"
#ifndef arg4alloc
#define arg4alloc unsigned
#endif
char * allocat(old, new)
char * old;
char * new;
{
register char * ret;
arg4alloc toalloc;
extern char * calloc();
extern char * realloc();
extern char * strcat();
if (new == NULL)
new = "";
toalloc = strlen(new) + 1;
ret = (old == NULL) ? calloc(toalloc, sizeof *ret) :
1985-01-14 22:52:38 -05:00
realloc(old, (toalloc + strlen(old)) * sizeof *ret);
if (ret != NULL)
(void) strcat(ret, new);
return ret;
}
char * allocpy(string)
char * string;
{
return allocat((char *) NULL, string);
}