diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-06-05 04:14:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-06-05 04:16:46 +0300 |
commit | b2e5c017a1a93ec9b6f001bae385c7cc9b756cca (patch) | |
tree | d0303021d6613fc40b6546d56dbf341469e282a0 /source/gameengine/Ketsji/KX_GameActuator.cpp | |
parent | f3434e5f827c651be10fdc4be2a008ac790980ea (diff) |
BGE: correct ftell use in LoadGlobalDict
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameActuator.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameActuator.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index c6087ac676d..a23af680104 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -178,6 +178,11 @@ bool KX_GameActuator::Update() // obtain file size: fseek (fp , 0 , SEEK_END); marshal_length = ftell(fp); + if (marshal_length == -1) { + printf("warning: could not read position of '%s'\n", mashal_path); + fclose(fp); + break; + } rewind(fp); marshal_buffer = (char*) malloc (sizeof(char)*marshal_length); |