This commit is contained in:
jl777
2019-03-02 22:36:38 -11:00
parent 548c281975
commit 59725a3c3e
2 changed files with 6 additions and 5 deletions

View File

@@ -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) 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); //fprintf(stderr,"rogue_progress num.%d\n",num);
if ( rs->guiflag != 0 && Gametxidstr[0] != 0 ) if ( rs->guiflag != 0 && Gametxidstr[0] != 0 )
{ {

View File

@@ -274,18 +274,19 @@ char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter)
{ {
fprintf(stderr,"error reallocating keystrokes\n"); fprintf(stderr,"error reallocating keystrokes\n");
fclose(fp); fclose(fp);
return(-1); return(0);
} }
if ( fread(&keystrokes[num],1,fsize,fp) != fsize ) if ( fread(&keystrokes[num],1,fsize,fp) != fsize )
{ {
fprintf(stderr,"error reading keystrokes from (%s)\n",fname); fprintf(stderr,"error reading keystrokes from (%s)\n",fname);
fclose(fp); fclose(fp);
return(-1); free(keystrokes);
return(0);
} }
fclose(fp); fclose(fp);
num += fsize; num += fsize;
counter++; 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; *numkeysp = num;
return(keystrokes); 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) 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 ) if ( seed == 0 )
seed = 777; seed = 777;
keystrokes = rogue_keystrokesload(&num,seed,counter); keystrokes = rogue_keystrokesload(&num,seed,counter);