diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2014-07-20 08:01:05 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2014-07-20 08:01:05 +0000 |
commit | d5dfa90eec9c108f86b9a0aa3f746a5b164c6649 (patch) | |
tree | e6eb1ae6ca89db58494b28d6c5124ea94c517c37 /plugins/SpellChecker/src/hunspell/filemgr.cxx | |
parent | 42c1d344fd105bcc25ae35e5a82d16a978b302c4 (diff) |
SpellChecker:
-Updated Hunspell to 1.3.3
-Create services in Load()
git-svn-id: http://svn.miranda-ng.org/main/trunk@9876 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/src/hunspell/filemgr.cxx')
-rw-r--r-- | plugins/SpellChecker/src/hunspell/filemgr.cxx | 15 |
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; } |