(wrmakesrc,wripglob,wrgamesdef,info,apro,mobupdate,rea,turn

upda,ef_open,logerror,emp_config,match_user,show_motd,gamedown,
typed_wu,delete_old_announcements,mobility_check,mobility_init,
allocate_memory,write_newcap_script,main,files,fairland,doconfig,)
[_WIN32]: Switchback to default mode of text.
"t" (text) is not included the ISO/ANSI C standard but "b" (binary)
is included.
This commit is contained in:
Ron Koenderink 2005-03-02 12:47:15 +00:00
parent d4af51c9e2
commit 55e6aca9e0
17 changed files with 28 additions and 41 deletions

View file

@ -305,7 +305,7 @@ info(void)
name = "TOP";
_snprintf(filename, sizeof(filename) - 1, "%s\\%s", infodir, name);
fp = fopen(filename, "r");
fp = fopen(filename, "rb");
if (fp == NULL) {
/* may be a "partial" request. */
HANDLE hDir;
@ -365,7 +365,7 @@ info(void)
}
_snprintf(filename, sizeof(filename), "%s/%s",
infodir, last);
fp = fopen(filename, "r");
fp = fopen(filename, "rb");
if (fp == NULL) {
pr("Error reading info file for %s\n", name);
logerror("Cannot open for \"%s\" info file (%s)",
@ -455,7 +455,7 @@ apro(void)
(fData.dwFileAttributes == FILE_ATTRIBUTE_READONLY))) {
_snprintf(filename, sizeof(filename), "%s\\%s", infodir,
fData.cFileName);
fp = fopen(filename, "r");
fp = fopen(filename, "rb");
alreadyhit = 0;
nll = nlhl = 0;
if (fp != NULL) {

View file

@ -61,7 +61,7 @@ mobupdate(void)
else
minites = atol(player->argp[1]) * 60;
time(&now);
if ((fp = fopen(timestampfil, "r+")) == NULL) {
if ((fp = fopen(timestampfil, "rb+")) == NULL) {
logerror("Unable to edit timestamp file.");
} else {
rewind(fp);

View file

@ -100,7 +100,7 @@ rea(void)
clear_telegram_is_new(player->cnum);
}
if ((telfp = fopen(mbox, "r+")) == 0) {
if ((telfp = fopen(mbox, "rb+")) == 0) {
logerror("telegram file %s", mbox);
return RET_FAIL;
}
@ -201,7 +201,7 @@ rea(void)
/* Here, we just re-open the file for "w" only,
and that will wipe the file clean automatically */
(void)fclose(telfp);
telfp = fopen((char *)mbox, "w");
telfp = fopen((char *)mbox, "wb");
}
}
}

View file

@ -95,7 +95,7 @@ turn(void)
pr("Writing empty no-login message.\n");
}
fptr = fopen(msgfilepath, "w");
fptr = fopen(msgfilepath, "wb");
if (fptr == NULL) {
pr("Something went wrong opening the message file.\n");
logerror("Could not open message file (%s).\n", msgfilepath);

View file

@ -51,7 +51,7 @@ upda(void)
struct mob_acc_globals timestamps;
if (opt_MOB_ACCESS) {
if ((fp = fopen(timestampfil, "r")) == NULL)
if ((fp = fopen(timestampfil, "rb")) == NULL)
logerror("Unable to open timestamp file.");
else {
rewind(fp);