From 59725a3c3e47ee54cb068735360ae5b063dda2f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 22:36:38 -1100 Subject: [PATCH] Syntax --- src/cc/rogue/main.c | 2 +- src/cc/rogue/rogue.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cc/rogue/main.c b/src/cc/rogue/main.c index eeb085192..4e6221aa1 100644 --- a/src/cc/rogue/main.c +++ b/src/cc/rogue/main.c @@ -742,7 +742,7 @@ int32_t rogue_sendrawtransaction(char *rawtx) void rogue_progress(struct rogue_state *rs,int32_t waitflag,uint64_t seed,char *keystrokes,int32_t num) { - char cmd[16384],hexstr[16384],params[32768],*retstr,*rawtx; int32_t i; cJSON *retjson; + char cmd[16384],hexstr[16384],params[32768],*retstr,*rawtx,*pastkeys; int32_t i,numpastkeys; cJSON *retjson; //fprintf(stderr,"rogue_progress num.%d\n",num); if ( rs->guiflag != 0 && Gametxidstr[0] != 0 ) { diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index 57890207b..478e3d2ed 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -274,18 +274,19 @@ char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter) { fprintf(stderr,"error reallocating keystrokes\n"); fclose(fp); - return(-1); + return(0); } if ( fread(&keystrokes[num],1,fsize,fp) != fsize ) { fprintf(stderr,"error reading keystrokes from (%s)\n",fname); fclose(fp); - return(-1); + free(keystrokes); + return(0); } fclose(fp); num += fsize; counter++; - fprintf(stderr,"loaded %ld from (%s) total %ld\n",fsize,fname,num); + fprintf(stderr,"loaded %ld from (%s) total %d\n",fsize,fname,num); } *numkeysp = num; return(keystrokes); @@ -293,7 +294,7 @@ char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter) int32_t rogue_replay(uint64_t seed,int32_t sleeptime) { - FILE *fp; char fname[1024]; char *keystrokes = 0; long num=0,fsize; int32_t i,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; + FILE *fp; char fname[1024]; char *keystrokes = 0; long fsize; int32_t i,num=0,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; if ( seed == 0 ) seed = 777; keystrokes = rogue_keystrokesload(&num,seed,counter);