1 #pragma ident "%Z%%M% %I% %E% SMI"
3 /* static char elsieid[] = "@(#)ialloc.c 8.29"; */
9 #define nonzero(n) (((n) == 0) ? 1 : (n))
15 return (malloc((size_t) nonzero(n
)));
19 irealloc(pointer
, size
)
24 return (imalloc(size
));
25 return (realloc((void *) pointer
, (size_t) nonzero(size
)));
31 const char * const new;
33 register char * result
;
34 register int oldsize
, newsize
;
36 newsize
= (new == NULL
) ? 0 : strlen(new);
39 else if (newsize
== 0)
41 else oldsize
= strlen(old
);
42 if ((result
= irealloc(old
, oldsize
+ newsize
+ 1)) != NULL
)
44 (void) strcpy(result
+ oldsize
, new);
50 const char * const string
;
52 return (icatalloc((char *) NULL
, string
));