- else
- {
- merror(SIZE_ERROR,ARGV0,str);
- return(NULL);
- }
- }
- else /*at is not null. Need to reallocat its memory and copy str to it*/
- {
- int strsize = strlen(str);
- int atsize = strlen(at);
- int finalsize = atsize+strsize+1;
-
- if((atsize > OS_SIZE_2048) || (strsize > OS_SIZE_2048))
- {
- merror(SIZE_ERROR,ARGV0,str);
- return(NULL);
+ return (at);
+ } else { /* at is not null. Need to reallocate its memory and copy str to it */
+ char *newat;
+ size_t strsize = strlen(str);
+ size_t finalsize = strsize + strlen(at) + 1;
+
+ newat = (char *) realloc(at, finalsize * sizeof(char));
+ if (newat == NULL) {
+ free(at);
+ merror(MEM_ERROR, __local_name, errno, strerror(errno));
+ return (NULL);