summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/src/hunspell/hunzip.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SpellChecker/src/hunspell/hunzip.cxx')
-rw-r--r--plugins/SpellChecker/src/hunspell/hunzip.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/SpellChecker/src/hunspell/hunzip.cxx b/plugins/SpellChecker/src/hunspell/hunzip.cxx
index ecd8c7da77..c4c811dcd6 100644
--- a/plugins/SpellChecker/src/hunspell/hunzip.cxx
+++ b/plugins/SpellChecker/src/hunspell/hunzip.cxx
@@ -1,4 +1,4 @@
-#include "..\commons.h"
+#include "..\commons.h"
#define CODELEN 65536
#define BASEBITREC 5000
@@ -13,15 +13,17 @@ int Hunzip::fail(const char * err, const char * par) {
return -1;
}
-Hunzip::Hunzip(const char * file, const char * key) {
- bufsiz = 0;
- lastbit = 0;
- inc = 0;
- outc = 0;
- dec = NULL;
- fin = NULL;
- filename = (char *) malloc(strlen(file) + 1);
- if (filename) strcpy(filename, file);
+Hunzip::Hunzip(const char * file, const char * key)
+ : fin(NULL)
+ , bufsiz(0)
+ , lastbit(0)
+ , inc(0)
+ , inbits(0)
+ , outc(0)
+ , dec(NULL)
+{
+ in[0] = out[0] = line[0] = '\0';
+ filename = mystrdup(file);
if (getcode(key) == -1) bufsiz = -1;
else bufsiz = getbuf();
}
@@ -34,7 +36,7 @@ int Hunzip::getcode(const char * key) {
if (!filename) return -1;
- fin = fopen(filename, "rb");
+ fin = myfopen(filename, "rb");
if (!fin) return -1;
// read magic number