summaryrefslogtreecommitdiff
path: root/src/SessionSerializer.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-03-03 13:19:52 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-03-03 13:19:52 +0900
commitf4469b79aae12b16f85b556001cb077f249e8b02 (patch)
tree3ea4695657d55b2abf4d7ea63b13edeab43fd2f4 /src/SessionSerializer.cc
parent910e40f128c7a7030f22c6f209e31688918fb56e (diff)
SessionSerializer crash when filename length is less than 3
Diffstat (limited to 'src/SessionSerializer.cc')
-rw-r--r--src/SessionSerializer.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/SessionSerializer.cc b/src/SessionSerializer.cc
index 3f95ed53..0c595dcb 100644
--- a/src/SessionSerializer.cc
+++ b/src/SessionSerializer.cc
@@ -72,7 +72,7 @@ bool SessionSerializer::save(const std::string& filename) const
{
SharedHandle<BufferedFile> fp;
#if HAVE_ZLIB
- if (filename.compare(filename.length() - 3, 3, ".gz") == 0) {
+ if (util::endsWith(filename, ".gz")) {
fp.reset(new GZipFile(tempFilename.c_str(), BufferedFile::WRITE));
}
else