Merge branch 'tmj-dev' into lua

This commit is contained in:
milek7
2017-09-05 20:20:28 +02:00
15 changed files with 254 additions and 179 deletions

View File

@@ -74,10 +74,10 @@ bool TPythonInterpreter::loadClassFile( std::string const &lookupPath, std::stri
if (sourceFile != nullptr)
{
fseek(sourceFile, 0, SEEK_END);
long fsize = ftell(sourceFile);
auto const fsize = ftell(sourceFile);
char *buffer = (char *)calloc(fsize + 1, sizeof(char));
fseek(sourceFile, 0, SEEK_SET);
size_t freaded = fread(buffer, sizeof(char), fsize, sourceFile);
auto const freaded = fread(buffer, sizeof(char), fsize, sourceFile);
buffer[freaded] = 0; // z jakiegos powodu czytamy troche mniej i trzczeba dodac konczace
// zero do bufora (mimo ze calloc teoretycznie powiniene zwrocic
// wyzerowana pamiec)