Move clonestr

This commit is contained in:
jl777
2019-03-25 10:20:53 -11:00
parent be9c3500ac
commit 361c928fc8

View File

@@ -2706,23 +2706,6 @@ int main(int argc, char **argv)
#include <curses.h> #include <curses.h>
#endif #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. Convert a tetromino type to its corresponding cell.
*/ */
@@ -3466,6 +3449,22 @@ void init_colors(void)
Main tetris game! Main tetris game!
*/ */
#ifdef STANDALONE #ifdef STANDALONE
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);
}
int tetris(int argc, char **argv) int tetris(int argc, char **argv)
{ {