alloc.c registerized

SCCS-file: ialloc.c
SCCS-SID: 5.13
This commit is contained in:
Arthur David Olson
2012-07-18 03:01:32 -04:00
committed by Paul Eggert
parent a7217225f3
commit f4c9dc4be7
+10 -10
View File
@@ -11,14 +11,14 @@ extern char * realloc();
extern char * strcpy();
extern char * strcat();
char * allocpy(string)
char * string;
char * allocpy(string)
register char * string;
{
register char * copy;
arg4alloc n;
register char * copy;
register arg4alloc n;
n = (string == NULL) ? 0 : strlen(string);
copy = malloc(++n);
copy = malloc(n + 1);
if (copy == MAL || copy == NULL)
return NULL;
if (string == NULL)
@@ -27,15 +27,15 @@ char * string;
return copy;
}
char * allocat(old, new)
char * old;
char * new;
char * allocat(old, new)
register char * old;
char * new;
{
arg4alloc n;
register arg4alloc n;
n = (old == NULL) ? 0 : strlen(old);
if (new != NULL)
n = n + strlen(new);
n += strlen(new);
++n;
if (old == MAL || old == NULL) {
old = malloc(n);