diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 16:19:54 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 16:19:54 +0100 |
commit | ad148587dcf5244c2d2011dba339786c765c54c4 (patch) | |
tree | bdd914121cd326da2ed26679838878e3edffc841 /src/client/filecache.cpp | |
parent | 1145b05ea0bda87dc0827821385810eced08f774 (diff) | |
download | dragonfireclient-ad148587dcf5244c2d2011dba339786c765c54c4.tar.xz |
Make Lint Happy
Diffstat (limited to 'src/client/filecache.cpp')
-rw-r--r-- | src/client/filecache.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/client/filecache.cpp b/src/client/filecache.cpp index 46bbe4059..0c8f06198 100644 --- a/src/client/filecache.cpp +++ b/src/client/filecache.cpp @@ -32,28 +32,28 @@ bool FileCache::loadByPath(const std::string &path, std::ostream &os) { std::ifstream fis(path.c_str(), std::ios_base::binary); - if(!fis.good()){ - verbosestream<<"FileCache: File not found in cache: " - <<path<<std::endl; + if (!fis.good()) { + verbosestream << "FileCache: File not found in cache: " << path + << std::endl; return false; } bool bad = false; - for(;;){ + for (;;) { char buf[1024]; fis.read(buf, 1024); std::streamsize len = fis.gcount(); os.write(buf, len); - if(fis.eof()) + if (fis.eof()) break; - if(!fis.good()){ + if (!fis.good()) { bad = true; break; } } - if(bad){ - errorstream<<"FileCache: Failed to read file from cache: \"" - <<path<<"\""<<std::endl; + if (bad) { + errorstream << "FileCache: Failed to read file from cache: \"" << path + << "\"" << std::endl; } return !bad; @@ -61,13 +61,10 @@ bool FileCache::loadByPath(const std::string &path, std::ostream &os) bool FileCache::updateByPath(const std::string &path, const std::string &data) { - std::ofstream file(path.c_str(), std::ios_base::binary | - std::ios_base::trunc); + std::ofstream file(path.c_str(), std::ios_base::binary | std::ios_base::trunc); - if(!file.good()) - { - errorstream<<"FileCache: Can't write to file at " - <<path<<std::endl; + if (!file.good()) { + errorstream << "FileCache: Can't write to file at " << path << std::endl; return false; } |