mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 23:17:27 +00:00
Fixed LoadFile crashing on directory arguments.
Change-Id: I737f6fd0bb1302ab7cfa6ab8b06108e221ebb63c Tested: on Linux.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user