diff --git a/src/Nodehun.cc b/src/Nodehun.cc index e1a841a..a96c50a 100644 --- a/src/Nodehun.cc +++ b/src/Nodehun.cc @@ -65,7 +65,9 @@ Nodehun::Nodehun(const Napi::CallbackInfo& info) : Napi::ObjectWrap(inf Napi::Buffer affixBuffer = info[0].As>(); Napi::Buffer dictionaryBuffer = info[1].As>(); - context = new HunspellContext(new Hunspell(affixBuffer.Data(), dictionaryBuffer.Data(), NULL, true)); + std::string affixStr(affixBuffer.Data(), affixBuffer.Length()); + std::string dictionaryStr(dictionaryBuffer.Data(), dictionaryBuffer.Length()); + context = new HunspellContext(new Hunspell(affixStr.c_str(), dictionaryStr.c_str(), NULL, true)); }; Nodehun::~Nodehun() {