vinniefalco / BeastLounge

Massively Multiplayer Online Blackjack Game using Boost.Beast
http://beastlounge.com
Boost Software License 1.0
2 stars 0 forks source link

parse_file() reads at the end-of-file after fseek() #22

Open kervinpierre opened 4 years ago

kervinpierre commented 4 years ago

parse_file() fseek()'s to the EOF to determine its size. But it then does a fread() on that file without rewinding the file pointer.

https://github.com/vinniefalco/BeastLounge/blob/develop/server/server.cpp#L115

The parse_file() function was introduced here: https://github.com/vinniefalco/BeastLounge/commit/0cc396faf911fb483c5bb5413a50c53b204550d5#diff-3985278eaa02e0ecb1c184941c13eeb3

This function fails for me Windows 10/VS2019.

Expected: A rewind after ftell, but before fread fseek(f, 0, SEEK_SET);

vinniefalco commented 4 years ago

Should be fixed in the latest develop