From f83da7830241f3c22878b8a279be2fa1971f6ea9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 25 Mar 2019 10:14:14 -1100 Subject: [PATCH] char *clonestr(char *str) --- src/cc/gamescc.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/cc/gamescc.cpp b/src/cc/gamescc.cpp index 4d461ee08..cd87e9995 100644 --- a/src/cc/gamescc.cpp +++ b/src/cc/gamescc.cpp @@ -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 *)""; - } - 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 #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 *)""; + } + len = strlen(str); + clone = (char *)calloc(1,len+16); + strcpy(clone,str); + return(clone); +} /* Convert a tetromino type to its corresponding cell.