mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2026-09-12 04:22:01 +00:00
34 lines
584 B
C
34 lines
584 B
C
#include "objectid.h"
|
|
OBJECTID("%W%")
|
|
|
|
/*LINTLIBRARY*/
|
|
|
|
#include <stdio.h>
|
|
#include "alloc.h"
|
|
|
|
char * allocat(old, new)
|
|
char * old;
|
|
char * new;
|
|
{
|
|
register char * ret;
|
|
register len;
|
|
extern char * calloc();
|
|
extern char * realloc();
|
|
extern char * strcat();
|
|
|
|
if (new == NULL)
|
|
new = "";
|
|
len = strlen(new) + 1;
|
|
ret = (old == NULL) ? calloc((arg4alloc) len, sizeof *ret) :
|
|
realloc(old, (arg4alloc) ((len + strlen(old)) * sizeof *ret));
|
|
if (ret != NULL)
|
|
(void) strcat(ret, new);
|
|
return ret;
|
|
}
|
|
|
|
char * allocpy(string)
|
|
char * string;
|
|
{
|
|
return allocat((char *) NULL, string);
|
|
}
|