summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/src/hunspell/filemgr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SpellChecker/src/hunspell/filemgr.cxx')
-rw-r--r--plugins/SpellChecker/src/hunspell/filemgr.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/SpellChecker/src/hunspell/filemgr.cxx b/plugins/SpellChecker/src/hunspell/filemgr.cxx
index bfd9554271..f6f2c146b2 100644
--- a/plugins/SpellChecker/src/hunspell/filemgr.cxx
+++ b/plugins/SpellChecker/src/hunspell/filemgr.cxx
@@ -1,14 +1,17 @@
-#include "..\commons.h"
+#include "..\commons.h"
int FileMgr::fail(const char * err, const char * par) {
fprintf(stderr, err, par);
return -1;
}
-FileMgr::FileMgr(const char * file, const char * key) {
- linenum = 0;
- hin = NULL;
- fin = fopen(file, "r");
+FileMgr::FileMgr(const char * file, const char * key)
+ : hin(NULL)
+ , linenum(0)
+{
+ in[0] = '\0';
+
+ fin = myfopen(file, "r");
if (!fin) {
// check hzipped file
char * st = (char *) malloc(strlen(file) + strlen(HZIP_EXTENSION) + 1);
@@ -32,7 +35,7 @@ char * FileMgr::getline() {
const char * l;
linenum++;
if (fin) return fgets(in, BUFSIZE - 1, fin);
- if (hin && (l = hin->getline())) return strcpy(in, l);
+ if (hin && ((l = hin->getline()) != NULL)) return strcpy(in, l);
linenum--;
return NULL;
}