10e2a9149SSascha Wildner /* 20e2a9149SSascha Wildner ** This file is in the public domain, so clarified as of 30e2a9149SSascha Wildner ** 2006-07-17 by Arthur David Olson. 40e2a9149SSascha Wildner */ 5984263bcSMatthew Dillon 61de703daSMatthew Dillon /* 71de703daSMatthew Dillon * $FreeBSD: src/usr.sbin/zic/ialloc.c,v 1.5 1999/08/28 01:21:18 peter Exp $ 81de703daSMatthew Dillon */ 9984263bcSMatthew Dillon /*LINTLIBRARY*/ 10984263bcSMatthew Dillon 11984263bcSMatthew Dillon #include "private.h" 12984263bcSMatthew Dillon 13984263bcSMatthew Dillon char * icatalloc(char * const old,const char * const new)14*402c9c91SSascha Wildnericatalloc(char *const old, const char * const new) 15984263bcSMatthew Dillon { 16a8ee260cSJoerg Sonnenberger char *result; 17a8ee260cSJoerg Sonnenberger int oldsize, newsize; 18984263bcSMatthew Dillon 19984263bcSMatthew Dillon newsize = (new == NULL) ? 0 : strlen(new); 20984263bcSMatthew Dillon if (old == NULL) 21984263bcSMatthew Dillon oldsize = 0; 22984263bcSMatthew Dillon else if (newsize == 0) 23