diff --git a/src/node-boilerplate/scrypt_common.cc b/src/node-boilerplate/scrypt_common.cc index 4df56b1..642f849 100644 --- a/src/node-boilerplate/scrypt_common.cc +++ b/src/node-boilerplate/scrypt_common.cc @@ -84,7 +84,7 @@ namespace { // // Returns error descriptions as generated by Scrypt // - const char* ScryptErrorDescr(const unsigned int error) { + std::string ScryptErrorDescr(const unsigned int error) { unsigned int mask = -1, base_error = (mask >> 16) & error, @@ -106,7 +106,7 @@ namespace NodeScrypt { // v8::Local ScryptError(const unsigned int error) { Nan::EscapableHandleScope scope; - v8::Local scryptError = Nan::Error(ScryptErrorDescr(error)); + v8::Local scryptError = Nan::Error(ScryptErrorDescr(error).c_str()); return scope.Escape(scryptError); } } //end Scrypt namespace