X-Git-Url: http://git.tdb.fi/?p=ext%2Fsubsurface.git;a=blobdiff_plain;f=file.c;h=da498995cc0c1522c802a86f4d34ae4522023702;hp=e0163909e9160f59f1f74ea667e50ec52684ef30;hb=642c83f5327317780a0f10b3ab46f6c1bd8bb202;hpb=415383d65ef425de8ddee86324632e3f720827f9 diff --git a/file.c b/file.c index e016390..da49899 100644 --- a/file.c +++ b/file.c @@ -8,6 +8,11 @@ #include "dive.h" #include "file.h" +/* Crazy windows sh*t */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + static int readfile(const char *filename, struct memblock *mem) { int ret, fd; @@ -17,7 +22,7 @@ static int readfile(const char *filename, struct memblock *mem) mem->buffer = NULL; mem->size = 0; - fd = open(filename, O_RDONLY); + fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) return fd; ret = fstat(fd, &st);