Normally when it finds a new game if see debug code like this.


Code:
Tablevar2 <#2439431Speed>
tabname<#2439431Speed>
finished loop <K.I.N.G.>
SEATED adding PLAYER <K.I.N.G.>
finished loop <Pyran1a>
SEATED adding PLAYER <Pyran1a>
finished loop <Urkarian>
SEATED adding PLAYER <Urkarian>
finished loop <collocollo>
SEATED adding PLAYER <collocollo>
finished loop <fxm341>
SEATED adding PLAYER <fxm341>
finished loop <gamas824>
SEATED adding PLAYER <gamas824>
finished loop <george_shrub>
SEATED adding PLAYER <george_shrub>
finished loop <gordonebula>
SEATED adding PLAYER <gordonebula>
finished loop <moliner0001>
SEATED adding PLAYER <moliner0001>
 debug1 <0.05 USD].>
 debug12 
 var1 <gamas824 posts small blind [$0.05 USD].>
 debug12aa

But after a point I instead see debug like this which indicates things have got out of step.

Code:
int <>
Hint <#Game No : 11600365239 >
Hint <***** Hand History for Game 11600365239 *****>
Hint <$10 USD NL Texas Hold'em - Thursday, March 29, 20:33:40 EDT 2012>
Hint <Table Speed #2439431 (No DP) (Real Money)>
Hint <Seat 8 is the button>
Hint <Total number of players : 9/9 >
Hint <Seat 2: K.I.N.G. ( $9.80 USD )>
Hint <Seat 3: Pyran1a ( $9.95 USD )>
Hint <Seat 4: collocollo ( $21.46 USD )>
Hint <Seat 7: fxm341 ( $10 USD )>
Hint <Seat 8: gamas824 ( $11.07 USD )>
Hint <Seat 9: george_shrub ( $9.70 USD )>
Hint <Seat 5: gordonebula ( $10.45 USD )>
Hint <Seat 1: kbzita88 ( $14.55 USD )>
Hint <Seat 6: moliner0001 ( $10 USD )>
 debug1 <0.05 USD].>
 debug12


Manifest in this lovely piece of code
But the actually error occurs prior to this I think.

I know it is horrible code because I changed it for a different site

Code:

			if (finished==FALSE){             //PROCESS SEATING
				do {
					rn=fscanf(game_file_ptr,"%[^\n]\n",var1);  
				if (rn==-1) {
					printf("\n bad read1564b"); //                            END OF A GAME
					break;
				}
					if ((strncmp("-----",var1,5))==0)  break;
					if ((strncmp("Seat ",var1,5))==0) {
	//					printf("\n%s",var1); 
				//		sscanf(var1,"Seat %d: %s %[^\n]\n",&seatnum,player,var1);
							sscanf(var1,"Seat %d: %[^(] %[^\n]\n",&seatnum,player,var1);

						{ int k;
						k=0; k=strlen(player) -1;player[k]=0;}

						printf("\nfinished loop <%s>", player);
						if(var1[0]!='\(') {
					//		printf("\nZ2");
							sscanf(var1,"%s",var2);
							if(strcmp(var2,"sits")){
								/*printf("\nZ3");*/
								sprintf(player,"%s %s",player,var2);
							}
						}
						printf("\nSEATED adding PLAYER <%s>",player);

						addlist(); 	seatfound=TRUE;	onefound=TRUE;
										}
					else {		seatfound = FALSE;		}
					if ((onefound ==TRUE) && (seatfound ==FALSE)) {
						finished=TRUE;	skipread=TRUE;
						/*printf("\nSKIPread\n");*/
						break;
					}
				}
				while (  rn!=-1);/*not end of file or break at end of names */
				if (rn==-1){   	rn=0;	break;	}
			} /* if finished is false */
			if (skipread==FALSE) {
			printf("\nHint <%s>",var1);
				rn=fscanf(game_file_ptr,"%[^\n]\n",var1);  
				if (rn==-1) {
					printf("\n bad read1b4343"); //                            END OF A GAME
					break;
				}
//			printf("\nINPUT55<%s>",var1);
				skipread=TRUE;
			
			}
			skipread=FALSE;
So there is a problem there even if it's not the one which cause the bug. I wrote this stuff ages ago and only recently revisited.

One problem was using fscanf which skips over blank lines, that caused problems because the blank line indicates the end of a game, so instead I relied upon other things.
ie when someone wins the game as here.


Code:
gamas824 does not show cards.
gamas824 wins $0.15 USD
 Game #11600427288 starts.

#Game No : 11600427288 
***** Hand History for Game 11600427288 *****
$10 USD NL Texas Hold'em - Thursday, March 29, 21:17:04 EDT 2012
Table Speed #2439431 (No DP) (Real Money)


However that caused problems when someone left the game as shown here, so things could get out of sync.


Code:
fxm341 wins $1.50 USD
kbzita88 has left the table.
 Game #11600428515 starts.

#Game No : 11600428515 
***** Hand History for Game 11600428515 *****
$10 USD NL Texas Hold'em - Thursday, March 29, 21:18:01 EDT 2012
Table Speed #2439431 (No DP) (Real Money)

So I may have to rewrite that section. (which is gonna be a real pain as it involves sorting out the mess i made trying to cure it in the first place!!). I realise after I wrote it I could have done a number of things a lot better but I just want ed to get something up and working fast.