diff --git a/src/cc/cclib.cpp b/src/cc/cclib.cpp index a595f5559..625872483 100644 --- a/src/cc/cclib.cpp +++ b/src/cc/cclib.cpp @@ -148,7 +148,7 @@ cJSON *cclib_reparse(int32_t *nump,char *jsonstr) // assumes origparams will be } newstr[j] = 0; params = cJSON_Parse(newstr); - if ( 1 && params != 0 ) + if ( 0 && params != 0 ) printf("new.(%s) -> %s\n",newstr,jprint(params,0)); free(newstr); *nump = cJSON_GetArraySize(params); diff --git a/src/cc/rogue/main.c b/src/cc/rogue/main.c index af357feb8..32967614c 100644 --- a/src/cc/rogue/main.c +++ b/src/cc/rogue/main.c @@ -727,7 +727,7 @@ void rogue_progress(struct rogue_state *rs,uint64_t seed,char *keystrokes,int32_ int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr) { - char cmd[32768]; int32_t i,n,retval=-1; char params[1024],*filestr=0,*pname,*statusstr,*datastr,fname[128]; long allocsize; cJSON *retjson,*array,*item; + char cmd[32768]; int32_t i,n,retval=-1; char params[1024],*filestr=0,*pname,*statusstr,*datastr,fname[128]; long allocsize; cJSON *retjson,*array,*item,*resultjson; if ( rs->guiflag == 0 ) return(-1); if ( gametxidstr == 0 || *gametxidstr == 0 ) @@ -747,10 +747,10 @@ int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr) } if ( filestr != 0 ) { - fprintf(stderr,"gameinfo.(%s)\n",filestr); - if ( (retjson= cJSON_Parse(filestr)) != 0 ) + if ( (retjson= cJSON_Parse(filestr)) != 0 && (resultjson= jitem(retjson,"result")) != 0 ) { - if ( (array= jarray(&n,retjson,"players")) != 0 ) + fprintf(stderr,"gameinfo.(%s)\n",jprint(resultjson,0)); + if ( (array= jarray(&n,resultjson,"players")) != 0 ) { for (i=0; i