diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-03-03 13:19:52 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-03-03 13:19:52 +0900 |
| commit | f4469b79aae12b16f85b556001cb077f249e8b02 (patch) | |
| tree | 3ea4695657d55b2abf4d7ea63b13edeab43fd2f4 /src/SessionSerializer.cc | |
| parent | 910e40f128c7a7030f22c6f209e31688918fb56e (diff) | |
SessionSerializer crash when filename length is less than 3
Diffstat (limited to 'src/SessionSerializer.cc')
| -rw-r--r-- | src/SessionSerializer.cc | 2 |
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 |
