aboutsummaryrefslogtreecommitdiffstats
path: root/highscore.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2003-03-28 05:00:09 +0000
committerH. Peter Anvin <hpa@zytor.com>2003-03-28 05:00:09 +0000
commit22c861e95c569911ed7398fe7fc64b69dcbb5dc4 (patch)
tree41ff2d545b1358d182be411a8115616d1aca9081 /highscore.c
parentc3aadb29c59e52d4a7cca3a1dc269a3c388695ff (diff)
downloadgrv-22c861e95c569911ed7398fe7fc64b69dcbb5dc4.tar.gz
grv-22c861e95c569911ed7398fe7fc64b69dcbb5dc4.tar.xz
grv-22c861e95c569911ed7398fe7fc64b69dcbb5dc4.zip
Try to fix broken Windows networking... *sigh*
Diffstat (limited to 'highscore.c')
-rw-r--r--highscore.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/highscore.c b/highscore.c
index b93cb82..bd1df34 100644
--- a/highscore.c
+++ b/highscore.c
@@ -23,17 +23,18 @@ static const char score_file[] = "grvscore.dat";
void highscore_download(void)
{
FILE *f;
+ netcon_t n;
f = fopen(score_file, "r");
if ( f ) {
- highscore_parse(f);
+ highscore_parse(f, fgets);
fclose(f);
}
if ( !opt.nonet ) {
- if ( (f = fopen_network(score_server, score_dl_port, 0)) ) {
- highscore_parse(f);
- fclose_network(f);
+ if ( (n = fopen_network(score_server, score_dl_port, 0)) ) {
+ highscore_parse(n, fgets_network);
+ fclose_network(n);
}
}
}
@@ -42,17 +43,18 @@ void highscore_download(void)
void highscore_upload(void)
{
FILE *f;
+ netcon_t n;
f = fopen(score_file, "w");
if ( f ) {
- highscore_write(f);
+ highscore_write(f, fputs);
fclose(f);
}
if ( !opt.nonet ) {
- if ( (f = fopen_network(score_server, score_ul_port, 1)) ) {
- highscore_write(f);
- fclose_network(f);
+ if ( (n = fopen_network(score_server, score_ul_port, 1)) ) {
+ highscore_write(n, fputs_network);
+ fclose_network(n);
}
}
}