1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-19 23:09:30 +00:00
Files
amiga-tz/ialloc.c
Paul Eggert 5bfa967c17 Avoid (void) before calls.
Although the cast to void in usage like '(void) printf ("Hello")'
may have been helpful decades ago when Lint Was Your Friend,
nowadays such casts are not helpful.  The tz code is currently not
consistent about this: sometimes the casts are present, and
sometimes absent.  As they make the code harder to read, let's
remove them.
* asctime.c, date.c, ialloc.c, localtime.c, strftime.c, zdump.c, zic.c:
Don't cast calls to 'void'.
2014-08-25 08:19:47 -07:00

33 lines
614 B
C

/*
** This file is in the public domain, so clarified as of
** 2006-07-17 by Arthur David Olson.
*/
/*LINTLIBRARY*/
#include "private.h"
char *
icatalloc(char *const old, const char *const new)
{
register char * result;
register int oldsize, newsize;
newsize = (new == NULL) ? 0 : strlen(new);
if (old == NULL)
oldsize = 0;
else if (newsize == 0)
return old;
else oldsize = strlen(old);
if ((result = realloc(old, oldsize + newsize + 1)) != NULL)
if (new != NULL)
strcpy(result + oldsize, new);
return result;
}
char *
icpyalloc(const char *const string)
{
return icatalloc(NULL, string);
}