1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-20 10:22:31 +00:00
Files
amiga-tz/ialloc.c
Arthur David Olson 01b8495b97 consistency
SCCS-file: ialloc.c
SCCS-SID: 7.2
2012-07-18 03:01:34 -04:00

40 lines
627 B
C

#
/*LINTLIBRARY*/
#include "stdio.h"
#ifdef OBJECTID
static char sccsid[] = "%W%";
#endif
#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) :
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);
}