(main,mobility_check,upda,turn,rea,mobupdate,ef_open,logerror,
emp_config,gamedown,show_motd,match_user,typed_wu, delete_old_announcements) [_WIN32]: switch the default file mode to binary to match POSIX. Remove the now unneccessary ifdef for the open/fopen. Add text mode for user files (econfig/auth).
This commit is contained in:
parent
f6e78f4589
commit
1a8488bc45
13 changed files with 14 additions and 65 deletions
|
@ -100,11 +100,7 @@ rea(void)
|
|||
clear_telegram_is_new(player->cnum);
|
||||
}
|
||||
|
||||
#if !defined(_WIN32)
|
||||
if ((telfp = fopen(mbox, "r+")) == 0) {
|
||||
#else
|
||||
if ((telfp = fopen(mbox, "r+b")) == 0) {
|
||||
#endif
|
||||
logerror("telegram file %s", mbox);
|
||||
return RET_FAIL;
|
||||
}
|
||||
|
@ -208,11 +204,7 @@ rea(void)
|
|||
/* Here, we just re-open the file for "w" only,
|
||||
and that will wipe the file clean automatically */
|
||||
(void)fclose(telfp);
|
||||
#if !defined(_WIN32)
|
||||
telfp = fopen((char *)mbox, "w");
|
||||
#else
|
||||
telfp = fopen((char *)mbox, "wb");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue