summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-03 00:35:26 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-03 00:35:26 +0300
commit60cce948bc8419c15a7fe8ab9669f4ae87c5ef76 (patch)
treec9b7046a93904ba651bcc0c1881eb566fc97e37d /src/utils
parent80f2a4020254c020df6ba751a3d0e5dc1af0774e (diff)
downloadmanaverse-60cce948bc8419c15a7fe8ab9669f4ae87c5ef76.tar.gz
manaverse-60cce948bc8419c15a7fe8ab9669f4ae87c5ef76.tar.bz2
manaverse-60cce948bc8419c15a7fe8ab9669f4ae87c5ef76.tar.xz
manaverse-60cce948bc8419c15a7fe8ab9669f4ae87c5ef76.zip
another fixes from Coverity checks.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/translation/poparser.cpp11
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,