X-Git-Url: http://git.tdb.fi/?p=ext%2Fsubsurface.git;a=blobdiff_plain;f=file.c;h=da498995cc0c1522c802a86f4d34ae4522023702;hp=e0163909e9160f59f1f74ea667e50ec52684ef30;hb=HEAD;hpb=7fe652ab5738717ba443ae9de2b8f437103fd71b 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);