16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 07:49:19 +02:00

build 170903. scan table fixes, some const correctness improvements

This commit is contained in:
tmj-fstate
2017-09-04 19:08:59 +02:00
parent 5d7206b369
commit 2446468038
15 changed files with 254 additions and 220 deletions

View File

@@ -64,10 +64,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)