/* some x-functions, from ifmail package */ #include #include #include #include "config.h" void *__old_xmalloc(size) size_t size; { char *tmp; tmp=malloc(size); ass(tmp!=NULL); return tmp; } char *xstrcpy(src) char *src; { char *tmp; if (src == NULL) return(NULL); tmp=xmalloc(strlen(src)+1); strcpy(tmp,src); return tmp; } char *xstrcat(src,add) char *src,*add; { char *tmp; size_t size=0; if ((add == NULL) || (strlen(add) == 0)) return src; if (src) size=strlen(src); size+=strlen(add); tmp=xmalloc(size+1); *tmp='\0'; if (src) { strcpy(tmp,src); xfree(src); } strcat(tmp,add); return tmp; }