Commit 37a57e70 authored by nanahira's avatar nanahira

Merge branch 'master' into another

parents c5ba541c a49d2990
...@@ -3,17 +3,13 @@ os: ...@@ -3,17 +3,13 @@ os:
- linux - linux
- osx - osx
sudo: required sudo: required
dist: trusty dist: xenial
osx_image: xcode8 osx_image: xcode8
addons: addons:
ssh_known_hosts: ssh_known_hosts:
- github.com - github.com
apt: apt:
sources:
- ubuntu-toolchain-r-test
packages: packages:
- gcc-6
- g++-6
- libfreetype6-dev - libfreetype6-dev
- libevent-dev - libevent-dev
- libsqlite3-dev - libsqlite3-dev
...@@ -25,7 +21,6 @@ env: ...@@ -25,7 +21,6 @@ env:
- USE_IRRKLANG=1 - USE_IRRKLANG=1
before_install: before_install:
- git submodule update --init --recursive - git submodule update --init --recursive
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ln -s /usr/bin/gcc-6 /usr/local/bin/gcc; sudo ln -s /usr/bin/g++-6 /usr/local/bin/g++; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update > /dev/null; brew update > /dev/null;
brew install freetype libevent sqlite p7zip dylibbundler > /dev/null; brew install freetype libevent sqlite p7zip dylibbundler > /dev/null;
......
...@@ -170,7 +170,10 @@ bool Replay::OpenReplay(const wchar_t* name) { ...@@ -170,7 +170,10 @@ bool Replay::OpenReplay(const wchar_t* name) {
} }
if(!fp) if(!fp)
return false; return false;
fread(&pheader, sizeof(pheader), 1, fp); if(fread(&pheader, sizeof(pheader), 1, fp) < 1) {
fclose(fp);
return false;
}
if(pheader.flag & REPLAY_COMPRESSED) { if(pheader.flag & REPLAY_COMPRESSED) {
comp_size = fread(comp_data, 1, 0x1000, fp); comp_size = fread(comp_data, 1, 0x1000, fp);
fclose(fp); fclose(fp);
...@@ -199,9 +202,9 @@ bool Replay::CheckReplay(const wchar_t* name) { ...@@ -199,9 +202,9 @@ bool Replay::CheckReplay(const wchar_t* name) {
if(!rfp) if(!rfp)
return false; return false;
ReplayHeader rheader; ReplayHeader rheader;
fread(&rheader, sizeof(ReplayHeader), 1, rfp); size_t count = fread(&rheader, sizeof(ReplayHeader), 1, rfp);
fclose(rfp); fclose(rfp);
return rheader.id == 0x31707279 && rheader.version >= 0x12d0; return count == 1 && rheader.id == 0x31707279 && rheader.version >= 0x12d0;
} }
bool Replay::DeleteReplay(const wchar_t* name) { bool Replay::DeleteReplay(const wchar_t* name) {
wchar_t fname[256]; wchar_t fname[256];
......
...@@ -52,6 +52,7 @@ int SingleMode::SinglePlayThread(void* param) { ...@@ -52,6 +52,7 @@ int SingleMode::SinglePlayThread(void* param) {
myswprintf(mainGame->dInfo.strLP[1], L"%d", mainGame->dInfo.lp[1]); myswprintf(mainGame->dInfo.strLP[1], L"%d", mainGame->dInfo.lp[1]);
BufferIO::CopyWStr(mainGame->ebNickName->getText(), mainGame->dInfo.hostname, 20); BufferIO::CopyWStr(mainGame->ebNickName->getText(), mainGame->dInfo.hostname, 20);
mainGame->dInfo.clientname[0] = 0; mainGame->dInfo.clientname[0] = 0;
mainGame->dInfo.player_type = 0;
mainGame->dInfo.turn = 0; mainGame->dInfo.turn = 0;
mainGame->dInfo.announce_cache.clear(); mainGame->dInfo.announce_cache.clear();
char filename[256]; char filename[256];
......
Subproject commit 8872427627495ded6e8aa0e3e837e679b4c96484 Subproject commit f9454100847dcc6b777f98b39c737cc3c517703d
Subproject commit bc26f53a53296fc481b18044195f34c97066fd57 Subproject commit c3a8497c175a7a43522085687127048a8675eeee
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment