]> git.tdb.fi Git - ext/subsurface.git/blobdiff - file.c
Fix profile and average depth for freedives
[ext/subsurface.git] / file.c
diff --git a/file.c b/file.c
index 538f5c78312c060216726e71492b123e48b93d4b..da498995cc0c1522c802a86f4d34ae4522023702 100644 (file)
--- a/file.c
+++ b/file.c
@@ -8,16 +8,21 @@
 #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 = open(filename, O_RDONLY);
+       int ret, fd;
        struct stat st;
        char *buf;
 
        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);