Fixed LoadFile crashing on directory arguments.

Change-Id: I737f6fd0bb1302ab7cfa6ab8b06108e221ebb63c
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2016-05-25 17:47:44 -07:00
parent a98bff3ea1
commit 4ffc881fb6
3 changed files with 39 additions and 3 deletions

View File

@@ -35,9 +35,10 @@
#include <winbase.h>
#include <direct.h>
#else
#include <sys/stat.h>
#include <limits.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include "flatbuffers/flatbuffers.h"
@@ -124,6 +125,9 @@ FileExistsFunction SetFileExistsFunction(FileExistsFunction
// Check if file "name" exists.
bool FileExists(const char *name);
// Check if "name" exists and it is also a directory.
bool DirExists(const char *name);
// Load file "name" into "buf" returning true if successful
// false otherwise. If "binary" is false data is read
// using ifstream's text mode, otherwise data is read with