From 761656c54bc89fc44fd9a26f5466e5872636f85e Mon Sep 17 00:00:00 2001 From: bentley Date: Mon, 18 Jan 2010 15:40:19 -0700 Subject: [PATCH] fopen does not take a "t" mode "t" is a nonportable way of opening files in text mode. Windows opens files in text mode by default anyway, and in UNIX there is no text mode. (Passing "t" to fopen is undefined in standard C.) --- src/asm/fstack.c | 6 +++--- src/link/mapfile.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/asm/fstack.c b/src/asm/fstack.c index 05e2d7b5..3afcc06b 100644 --- a/src/asm/fstack.c +++ b/src/asm/fstack.c @@ -52,7 +52,7 @@ filesize(char *s) FILE *f; ULONG size = 0; - if ((f = fopen(s, "rt")) != NULL) { + if ((f = fopen(s, "r")) != NULL) { fseek(f, 0, SEEK_END); size = ftell(f); fclose(f); @@ -247,7 +247,7 @@ fstk_RunInclude(char *tzFileName) fstk_FindFile(tzFileName); //printf("INCLUDING: %s\n", tzFileName); - if ((f = fopen(tzFileName, "rt")) != NULL) { + if ((f = fopen(tzFileName, "r")) != NULL) { pushcontext(); nLineNo = 1; nCurrentStatus = STAT_isInclude; @@ -383,7 +383,7 @@ fstk_Init(char *s) fstk_FindFile(tzFileName); pFileStack = NULL; - if ((pCurrentFile = fopen(tzFileName, "rt")) != NULL) { + if ((pCurrentFile = fopen(tzFileName, "r")) != NULL) { nMacroCount = 0; nCurrentStatus = STAT_isInclude; strcpy(tzCurrentFileName, tzFileName); diff --git a/src/link/mapfile.c b/src/link/mapfile.c index cdd60db5..10524e03 100644 --- a/src/link/mapfile.c +++ b/src/link/mapfile.c @@ -17,7 +17,7 @@ SLONG sfbank; void SetMapfileName(char *name) { - mf = fopen(name, "wt"); + mf = fopen(name, "w"); if (!mf) errx(5, "Unable to open mapfile for writing"); @@ -26,7 +26,7 @@ SetMapfileName(char *name) void SetSymfileName(char *name) { - sf = fopen(name, "wt"); + sf = fopen(name, "w"); if (!sf) errx(5, "Unable to open symfile for writing");