Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update node_binding.cc
  • Loading branch information
nornagon authored Oct 29, 2019
commit f8fff4476acf2c49ca596ca58045d1f1b3eb4e99
2 changes: 1 addition & 1 deletion src/node_binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
if (mp == nullptr || mp->nm_context_register_func == nullptr) {
dlib->Close();
char errmsg[1024];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be PATH_MAX?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PATH_MAX + strlen("Module did not self-register.") + 1 i suppose?

given the code immediately below that also uses 1024 and includes *filename, I figured best to go for consistency :)

snprintf(errmsg, 1024, "Module did not self-register: '%s'.", *filename);
snprintf(errmsg, sizeof(errmsg), "Module did not self-register: '%s'.", *filename);
env->ThrowError(errmsg);
return false;
}
Expand Down