char *clonestr(char *str)

This commit is contained in:
jl777
2019-03-25 10:14:14 -11:00
parent ce31112c57
commit f83da78302

View File

@@ -1684,6 +1684,7 @@ void games_packitemstr(char *packitemstr,struct games_packitem *item)
char USERPASS[8192]; uint16_t GAMES_PORT;
extern char Gametxidstr[67];
char *clonestr(char *str);
#define MAXSTR 1024
char whoami[MAXSTR];
@@ -1859,23 +1860,6 @@ long _stripwhite(char *buf,int accept)
return(j);
}
char *clonestr(char *str)
{
char *clone; int32_t len;
if ( str == 0 || str[0] == 0 )
{
printf("warning cloning nullstr.%p\n",str);
#ifdef __APPLE__
while ( 1 ) sleep(1);
#endif
str = (char *)"<nullstr>";
}
len = strlen(str);
clone = (char *)calloc(1,len+16);
strcpy(clone,str);
return(clone);
}
char *parse_conf_line(char *line,char *field)
{
line += strlen(field);
@@ -2722,6 +2706,22 @@ int main(int argc, char **argv)
#include <curses.h>
#endif
char *clonestr(char *str)
{
char *clone; int32_t len;
if ( str == 0 || str[0] == 0 )
{
printf("warning cloning nullstr.%p\n",str);
#ifdef __APPLE__
while ( 1 ) sleep(1);
#endif
str = (char *)"<nullstr>";
}
len = strlen(str);
clone = (char *)calloc(1,len+16);
strcpy(clone,str);
return(clone);
}
/*
Convert a tetromino type to its corresponding cell.