X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gamelist.c;h=da123a47554b3f880eb7151b7ca9c1eb561d678e;hb=a5b8066ad78ddeec1ddcca3b31ee26fe1052fc89;hp=0a4979e86e8f806ced70e45b7c1aae9f42e918b0;hpb=fa8be4a3fc5d81e9ec1f6c218fcf55c95d34fd10;p=xboard.git diff --git a/gamelist.c b/gamelist.c old mode 100644 new mode 100755 index 0a4979e..da123a4 --- a/gamelist.c +++ b/gamelist.c @@ -317,10 +317,6 @@ void ClearGameInfo(gameInfo) if (gameInfo->outOfBook != NULL) { free(gameInfo->outOfBook); } - if (gameInfo->resultDetails != NULL) { - free(gameInfo->resultDetails); - } - GameListInitGameInfo(gameInfo); } @@ -343,7 +339,7 @@ GameListLineOld(number, gameInfo) return ret; } -#define MAX_FIELD_LEN 64 /* To avoid overflowing the buffer */ +#define MAX_FIELD_LEN 80 /* To avoid overflowing the buffer */ char * GameListLine( int number, GameInfo * gameInfo ) { @@ -431,12 +427,14 @@ char * GameListLineFull( int number, GameInfo * gameInfo ) char * round = gameInfo->round ? gameInfo->round : "?"; char * date = gameInfo->date ? gameInfo->date : "?"; char * oob = gameInfo->outOfBook ? gameInfo->outOfBook : ""; + char * reason = gameInfo->resultDetails ? gameInfo->resultDetails : ""; - int len = 64 + strlen(event) + strlen(site) + strlen(white) + strlen(black) + strlen(date) + strlen(oob); + int len = 64 + strlen(event) + strlen(site) + strlen(white) + strlen(black) + strlen(date) + strlen(oob) + strlen(reason); char *ret = (char *) malloc(len); - sprintf(ret, "%d, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\"", number, event, site, round, white, black, PGNResult(gameInfo->result), date, oob ); + sprintf(ret, "%d, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\"", + number, event, site, round, white, black, PGNResult(gameInfo->result), reason, date, oob ); return ret; }