diff --git a/src/doconfig/doconfig.c b/src/doconfig/doconfig.c index c47ea30a..7a2f22f9 100644 --- a/src/doconfig/doconfig.c +++ b/src/doconfig/doconfig.c @@ -40,6 +40,7 @@ #if !defined(_WIN32) #include #else +#include #include #include #define mkdir(dir,perm) _mkdir(dir) @@ -87,6 +88,10 @@ main(void) char *cp; char *pathname; +#if defined(_WIN32) + _fmode = _O_BINARY; +#endif + if ((pathname = safe_getcwd()) == NULL) { printf("Can't get current path!\n"); exit(-1); @@ -170,7 +175,7 @@ wrauth(char *filename) FILE *fp; printf("Writing %s\n", filename); - if ((fp = fopen(filename, "w")) == NULL) { + if ((fp = fopen(filename, "wt")) == NULL) { printf("Cannot open %s for writing, exiting.\n", filename); exit(-1); }