diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-03 00:35:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-03 00:35:26 +0300 |
commit | 60cce948bc8419c15a7fe8ab9669f4ae87c5ef76 (patch) | |
tree | c9b7046a93904ba651bcc0c1881eb566fc97e37d /src/utils/translation | |
parent | 80f2a4020254c020df6ba751a3d0e5dc1af0774e (diff) | |
download | mv-60cce948bc8419c15a7fe8ab9669f4ae87c5ef76.tar.gz mv-60cce948bc8419c15a7fe8ab9669f4ae87c5ef76.tar.bz2 mv-60cce948bc8419c15a7fe8ab9669f4ae87c5ef76.tar.xz mv-60cce948bc8419c15a7fe8ab9669f4ae87c5ef76.zip |
another fixes from Coverity checks.
Diffstat (limited to 'src/utils/translation')
-rw-r--r-- | src/utils/translation/poparser.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/utils/translation/poparser.cpp b/src/utils/translation/poparser.cpp index dc201d4b3..2c880ba27 100644 --- a/src/utils/translation/poparser.cpp +++ b/src/utils/translation/poparser.cpp @@ -46,8 +46,15 @@ void PoParser::openFile(std::string name) int size; char *buf = static_cast<char*>(resman->loadFile(getFileName(name), size)); - mFile.str(std::string(buf, size)); - free(buf); + if (buf) + { + mFile.str(std::string(buf, size)); + free(buf); + } + else + { + mFile.clear(); + } } PoDict *PoParser::load(const std::string &lang, const std::string &fileName, |