diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-09 08:12:47 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-09 08:12:47 +0000 |
commit | 03081bce2d7825360c8263fffe9fa1b96d15779b (patch) | |
tree | c847b600f8de52a388a1bf4d9026417292f12027 /crawl-ref | |
parent | c82961f47f630431eb1420493a3feec93c74ca2d (diff) | |
download | crawl-ref-03081bce2d7825360c8263fffe9fa1b96d15779b.tar.gz crawl-ref-03081bce2d7825360c8263fffe9fa1b96d15779b.zip |
[1750056] Fixed silly bug breaking cached maps on Windows.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1808 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/files.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/mapdef.cc | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 8874815e79..a9a20d204a 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1639,7 +1639,8 @@ void writeString(FILE* file, const std::string &s, int cap) if (length > cap) length = cap; writeShort(file, length); - write2(file, s.c_str(), length); + if (length) + write2(file, s.c_str(), length); } std::string readString(FILE *file, int cap) diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index fbc7cd4113..7324d3b964 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -1159,7 +1159,7 @@ void map_def::load() return; const std::string loadfile = get_descache_path(file, ".dsc"); - FILE *inf = fopen(loadfile.c_str(), "r"); + FILE *inf = fopen(loadfile.c_str(), "rb"); fseek(inf, cache_offset, SEEK_SET); read_full(inf); fclose(inf); |