- static char buf[8192];
- char buf1[MSG_SIZ];
-
- buf[0] = NULLCHAR;
-
- sprintf(buf1, "[Event \"%s\"]\n",
- gameInfo->event ? gameInfo->event : "?");
- strcat(buf, buf1);
- sprintf(buf1, "[Site \"%s\"]\n",
- gameInfo->site ? gameInfo->site : "?");
- strcat(buf, buf1);
- sprintf(buf1, "[Date \"%s\"]\n",
- gameInfo->date ? gameInfo->date : "?");
- strcat(buf, buf1);
- sprintf(buf1, "[Round \"%s\"]\n",
- gameInfo->round ? gameInfo->round : "-");
- strcat(buf, buf1);
- sprintf(buf1, "[White \"%s\"]\n",
- gameInfo->white ? gameInfo->white : "?");
- strcat(buf, buf1);
- sprintf(buf1, "[Black \"%s\"]\n",
- gameInfo->black ? gameInfo->black : "?");
- strcat(buf, buf1);
- sprintf(buf1, "[Result \"%s\"]\n", PGNResult(gameInfo->result));
- strcat(buf, buf1);
-
- if (gameInfo->whiteRating >= 0 ) {
- sprintf(buf1, "[WhiteElo \"%d\"]\n", gameInfo->whiteRating );
- strcat(buf, buf1);
- }
- if ( gameInfo->blackRating >= 0 ) {
- sprintf(buf1, "[BlackElo \"%d\"]\n", gameInfo->blackRating );
- strcat(buf, buf1);
- }
- if (gameInfo->timeControl != NULL) {
- sprintf(buf1, "[TimeControl \"%s\"]\n", gameInfo->timeControl);
- strcat(buf, buf1);
- }
- if (gameInfo->variant != VariantNormal) {
- sprintf(buf1, "[Variant \"%s\"]\n", VariantName(gameInfo->variant));
- strcat(buf, buf1);
- }
- if (gameInfo->extraTags != NULL) {
- strcat(buf, gameInfo->extraTags);
- }
- return buf;
+ fprintf(fp, "[Event \"%s\"]\n", gameInfo->event ? gameInfo->event : "?");
+ fprintf(fp, "[Site \"%s\"]\n", gameInfo->site ? gameInfo->site : "?");
+ fprintf(fp, "[Date \"%s\"]\n", gameInfo->date ? gameInfo->date : "?");
+ fprintf(fp, "[Round \"%s\"]\n", gameInfo->round ? gameInfo->round : "-");
+ fprintf(fp, "[White \"%s\"]\n", gameInfo->white ? gameInfo->white : "?");
+ fprintf(fp, "[Black \"%s\"]\n", gameInfo->black ? gameInfo->black : "?");
+ fprintf(fp, "[Result \"%s\"]\n", PGNResult(gameInfo->result));
+ if (gameInfo->whiteRating >= 0)
+ fprintf(fp, "[WhiteElo \"%d\"]\n", gameInfo->whiteRating);
+ if (gameInfo->blackRating >= 0)
+ fprintf(fp, "[BlackElo \"%d\"]\n", gameInfo->blackRating);
+ if (gameInfo->timeControl)
+ fprintf(fp, "[TimeControl \"%s\"]\n", gameInfo->timeControl);
+ if (gameInfo->variant != VariantNormal)
+ fprintf(fp, "[Variant \"%s\"]\n", VariantName(gameInfo->variant));
+ if (gameInfo->extraTags)
+ fputs(gameInfo->extraTags, fp);