diff --git a/arogue5/mdport.c b/arogue5/mdport.c index d479444..1235589 100644 --- a/arogue5/mdport.c +++ b/arogue5/mdport.c @@ -209,6 +209,15 @@ md_creat(char *file, int mode) return(fd); } +FILE * +md_fdopen(int fd, char *mode) +{ +#ifdef _WIN32 + return( _fdopen(fd, mode) ); +#else + return( fdopen(fd, mode) ); +#endif +} int md_normaluser() diff --git a/arogue5/rip.c b/arogue5/rip.c index 7a7e601..5b3dc52 100644 --- a/arogue5/rip.c +++ b/arogue5/rip.c @@ -209,7 +209,7 @@ short monst; printf("\nCannot open score_file.\n"); return; } - outf = (FILE *) fdopen(fd, "w"); + outf = (FILE *) md_fdopen(fd, "w"); /* Get this system's name */ thissys = md_gethostname(); diff --git a/arogue5/rogue.h b/arogue5/rogue.h index e3ebf71..9b4036e 100644 --- a/arogue5/rogue.h +++ b/arogue5/rogue.h @@ -983,6 +983,7 @@ extern char *md_getpass(); extern char *md_crypt(); extern char *md_getroguedir(); extern void md_init(); +extern FILE * md_fdopen(int fd, char *mode); /* * Now all the global variables