Skip to content

Commit

Permalink
bug: bad comparison of c string (#1347)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtgto authored Jul 2, 2020
1 parent be71925 commit 29debf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"peerDependenciesMeta": {
"node-gyp": {
"optional": true
"optional": true
}
},
"optionalDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/statement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ Napi::Object Statement::Init(Napi::Env env, Napi::Object exports) {
}

// A Napi InstanceOf for Javascript Objects "Date" and "RegExp"
bool OtherInstanceOf(Napi::Object source, char* object_type) {
if (object_type == "Date") {
bool OtherInstanceOf(Napi::Object source, const char* object_type) {
if (strncmp(object_type, "Date", 4) == 0) {
return source.InstanceOf(source.Env().Global().Get("Date").As<Function>());
} else if (object_type == "RegExp") {
} else if (strncmp(object_type, "RegExp", 6) == 0) {
return source.InstanceOf(source.Env().Global().Get("RegExp").As<Function>());
}

Expand Down

0 comments on commit 29debf3

Please sign in to comment.